OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkShader.h" | 10 #include "SkShader.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 bm.lockPixels(); | 26 bm.lockPixels(); |
27 *bm.getAddr8(0, 0) = 0; | 27 *bm.getAddr8(0, 0) = 0; |
28 bm.unlockPixels(); | 28 bm.unlockPixels(); |
29 return bm; | 29 return bm; |
30 } | 30 } |
31 | 31 |
32 class TinyBitmapGM : public GM { | 32 class TinyBitmapGM : public GM { |
33 public: | 33 public: |
34 TinyBitmapGM() { | 34 TinyBitmapGM() { |
35 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); | 35 this->setBGColor(0xFFDDDDDD); |
36 } | 36 } |
37 | 37 |
38 protected: | 38 protected: |
39 SkString onShortName() { | 39 SkString onShortName() { |
40 return SkString("tinybitmap"); | 40 return SkString("tinybitmap"); |
41 } | 41 } |
42 | 42 |
43 virtual SkISize onISize() { return SkISize::Make(100, 100); } | 43 virtual SkISize onISize() { return SkISize::Make(100, 100); } |
44 | 44 |
45 virtual void onDraw(SkCanvas* canvas) { | 45 virtual void onDraw(SkCanvas* canvas) { |
(...skipping 10 matching lines...) Expand all Loading... |
56 private: | 56 private: |
57 typedef GM INHERITED; | 57 typedef GM INHERITED; |
58 }; | 58 }; |
59 | 59 |
60 ////////////////////////////////////////////////////////////////////////////// | 60 ////////////////////////////////////////////////////////////////////////////// |
61 | 61 |
62 static GM* MyFactory(void*) { return new TinyBitmapGM; } | 62 static GM* MyFactory(void*) { return new TinyBitmapGM; } |
63 static GMRegistry reg(MyFactory); | 63 static GMRegistry reg(MyFactory); |
64 | 64 |
65 } | 65 } |
OLD | NEW |