| * Copyright 2011 Google Inc. |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| #include "sk_tool_utils.h" |
| static SkBitmap make_bitmap() { |
| *bm.getAddr32(0, 0) = SkPackARGB32(0x80, 0x80, 0, 0); |
| class TinyBitmapGM : public GM { |
| this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); |
| return SkString("tinybitmap"); |
| virtual SkISize onISize() { return SkISize::Make(100, 100); } |
| virtual void onDraw(SkCanvas* canvas) { |
| SkBitmap bm = make_bitmap(); |
| paint.setShader(SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode, |
| SkShader::kMirror_TileMode)); |
| canvas->drawPaint(paint); |
| ////////////////////////////////////////////////////////////////////////////// |
| static GM* MyFactory(void*) { return new TinyBitmapGM; } |
| static GMRegistry reg(MyFactory); |