1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 4cb93a386Sopenharmony_ci// HASH=211ec89418011aa6e54aa2cc9567e003 5cb93a386Sopenharmony_ciREG_FIDDLE(Bitmap_isNull, 256, 256, true, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci SkBitmap bitmap; 8cb93a386Sopenharmony_ci SkDebugf("empty bitmap does %shave pixels\n", bitmap.isNull() ? "not " : ""); 9cb93a386Sopenharmony_ci bitmap.setInfo(SkImageInfo::MakeA8(8, 8)); 10cb93a386Sopenharmony_ci SkDebugf("bitmap with dimensions does %shave pixels\n", bitmap.isNull() ? "not " : ""); 11cb93a386Sopenharmony_ci bitmap.allocPixels(); 12cb93a386Sopenharmony_ci SkDebugf("allocated bitmap does %shave pixels\n", bitmap.isNull() ? "not " : ""); 13cb93a386Sopenharmony_ci} 14cb93a386Sopenharmony_ci} // END FIDDLE 15