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 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 BitmapScrollGM() { | 56 BitmapScrollGM() { |
57 fInited = false; | 57 fInited = false; |
58 this->setBGColor(0xFFDDDDDD); | 58 this->setBGColor(0xFFDDDDDD); |
59 } | 59 } |
60 | 60 |
61 protected: | 61 protected: |
62 SkString onShortName() SK_OVERRIDE { | 62 SkString onShortName() SK_OVERRIDE { |
63 return SkString("bitmapscroll"); | 63 return SkString("bitmapscroll"); |
64 } | 64 } |
65 | 65 |
66 uint32_t onGetFlags() const SK_OVERRIDE { | |
67 return kSkipTiled_Flag; | |
68 } | |
69 | |
70 SkISize onISize() SK_OVERRIDE { | 66 SkISize onISize() SK_OVERRIDE { |
71 return SkISize::Make(800, 600); | 67 return SkISize::Make(800, 600); |
72 } | 68 } |
73 | 69 |
74 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 70 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
75 this->init(); | 71 this->init(); |
76 SkIRect scrollCenterRegion = SkIRect::MakeXYWH( | 72 SkIRect scrollCenterRegion = SkIRect::MakeXYWH( |
77 quarterWidth, quarterHeight, quarterWidth*2+1, quarterHeight*2+1); | 73 quarterWidth, quarterHeight, quarterWidth*2+1, quarterHeight*2+1); |
78 int x = quarterWidth; | 74 int x = quarterWidth; |
79 int y = quarterHeight; | 75 int y = quarterHeight; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 static const int quarterHeight = 14; | 146 static const int quarterHeight = 14; |
151 SkBitmap origBitmap; | 147 SkBitmap origBitmap; |
152 }; | 148 }; |
153 | 149 |
154 ////////////////////////////////////////////////////////////////////////////// | 150 ////////////////////////////////////////////////////////////////////////////// |
155 | 151 |
156 static GM* MyFactory(void*) { return new BitmapScrollGM; } | 152 static GM* MyFactory(void*) { return new BitmapScrollGM; } |
157 static GMRegistry reg(MyFactory); | 153 static GMRegistry reg(MyFactory); |
158 | 154 |
159 } | 155 } |
OLD | NEW |