make_raster_image.cpp 479 B

123456789101112131415161718
  1. /*
  2. * Copyright 2018 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "gm/gm.h"
  8. #include "include/core/SkCanvas.h"
  9. #include "include/core/SkImage.h"
  10. #include "include/core/SkRefCnt.h"
  11. #include "tools/Resources.h"
  12. DEF_SIMPLE_GM(makeRasterImage, canvas, 128,128) {
  13. if (auto img = GetResourceAsImage("images/color_wheel.png")) {
  14. canvas->drawImage(img->makeRasterImage(), 0,0);
  15. }
  16. }