skia2/gm/makeRasterImage.cpp
Hal Canary baa2a2806b tests: do not crash with missing resources.
Change-Id: I931853dc09559f84e23d961de5452ce8133518cf
Reviewed-on: https://skia-review.googlesource.com/c/172966
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-11-26 22:02:09 +00:00

17 lines
389 B
C++

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Resources.h"
#include "SkSurface.h"
#include "gm.h"
DEF_SIMPLE_GM(makeRasterImage, canvas, 128,128) {
if (auto img = GetResourceAsImage("images/color_wheel.png")) {
canvas->drawImage(img->makeRasterImage(), 0,0);
}
}