• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 #include "tools/fiddle/examples.h"
4 REG_FIDDLE(Bitmap_reset, 256, 256, true, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6     SkBitmap bitmap;
7     bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));
8     bitmap.allocPixels();
9     SkDebugf("width:%d height:%d isNull:%s\n", bitmap.width(), bitmap.height(),
10              bitmap.isNull() ? "true" : "false");
11     bitmap.reset();
12     SkDebugf("width:%d height:%d isNull:%s\n", bitmap.width(), bitmap.height(),
13              bitmap.isNull() ? "true" : "false");
14 }
15 }  // END FIDDLE
16