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 // HASH=db9dd91e0207c3941c09538555817b4b
5 REG_FIDDLE(Bitmap_getGenerationID, 256, 256, true, 0) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7     SkBitmap bitmap;
8     SkDebugf("empty id %u\n", bitmap.getGenerationID());
9     bitmap.allocPixels(SkImageInfo::MakeN32(64, 64, kOpaque_SkAlphaType));
10     SkDebugf("alloc id %u\n", bitmap.getGenerationID());
11     bitmap.eraseColor(SK_ColorRED);
12     SkDebugf("erase id %u\n", bitmap.getGenerationID());
13 }
14 }  // END FIDDLE
15