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=838202e0d49cad2eb3eeb495834f6d63 5cb93a386Sopenharmony_ciREG_FIDDLE(Pixmap_erase_2, 256, 50, false, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci uint32_t storage[2]; 8cb93a386Sopenharmony_ci SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2); 9cb93a386Sopenharmony_ci SkPixmap pixmap(info, storage, info.minRowBytes()); 10cb93a386Sopenharmony_ci pixmap.erase(SK_ColorBLUE); 11cb93a386Sopenharmony_ci SkBitmap bitmap; 12cb93a386Sopenharmony_ci canvas->scale(20, 20); 13cb93a386Sopenharmony_ci bitmap.installPixels(pixmap); 14cb93a386Sopenharmony_ci canvas->drawImage(bitmap.asImage(), 0, 0); 15cb93a386Sopenharmony_ci} 16cb93a386Sopenharmony_ci} // END FIDDLE 17