OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SkBitmap fBM; | 63 SkBitmap fBM; |
64 SkMatrix fMatrix[3]; | 64 SkMatrix fMatrix[3]; |
65 SkString fName; | 65 SkString fName; |
66 | 66 |
67 FilterBitmapGM() | 67 FilterBitmapGM() |
68 { | 68 { |
69 this->setBGColor(0xFFDDDDDD); | 69 this->setBGColor(0xFFDDDDDD); |
70 } | 70 } |
71 | 71 |
72 protected: | 72 protected: |
73 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 73 uint32_t onGetFlags() const SK_OVERRIDE { |
74 return kSkipTiled_Flag; | 74 return kSkipTiled_Flag; |
75 } | 75 } |
76 | 76 |
77 virtual SkString onShortName() SK_OVERRIDE { | 77 SkString onShortName() SK_OVERRIDE { |
78 return fName; | 78 return fName; |
79 } | 79 } |
80 | 80 |
81 virtual SkISize onISize() SK_OVERRIDE { | 81 SkISize onISize() SK_OVERRIDE { |
82 return SkISize::Make(1024, 768); | 82 return SkISize::Make(1024, 768); |
83 } | 83 } |
84 | 84 |
85 virtual void makeBitmap() = 0; | 85 virtual void makeBitmap() = 0; |
86 virtual SkScalar getScale() = 0; | 86 virtual SkScalar getScale() = 0; |
87 | 87 |
88 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 88 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
89 | 89 |
90 canvas->translate(10, 10); | 90 canvas->translate(10, 10); |
91 for (size_t i = 0; i < SK_ARRAY_COUNT(fMatrix); ++i) { | 91 for (size_t i = 0; i < SK_ARRAY_COUNT(fMatrix); ++i) { |
92 SkSize size = computeSize(fBM, fMatrix[i]); | 92 SkSize size = computeSize(fBM, fMatrix[i]); |
93 size.fWidth += 20; | 93 size.fWidth += 20; |
94 size.fHeight += 20; | 94 size.fHeight += 20; |
95 | 95 |
96 draw_row(canvas, fBM, fMatrix[i], size.fWidth); | 96 draw_row(canvas, fBM, fMatrix[i], size.fWidth); |
97 canvas->translate(0, size.fHeight); | 97 canvas->translate(0, size.fHeight); |
98 } | 98 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) | 222 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) |
223 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) | 223 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) |
224 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) | 224 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) |
225 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) | 225 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) |
226 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) | 226 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) |
227 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) | 227 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) |
228 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) | 228 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) |
229 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) | 229 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) |
230 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) | 230 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) |
231 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) | 231 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) |
OLD | NEW |