| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 protected: | 61 protected: |
| 62 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 62 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 63 return kSkipTiled_Flag; | 63 return kSkipTiled_Flag; |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual SkString onShortName() { | 66 virtual SkString onShortName() { |
| 67 return SkString("bitmapscroll"); | 67 return SkString("bitmapscroll"); |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual SkISize onISize() { | 70 virtual SkISize onISize() { |
| 71 return make_isize(800, 600); | 71 return SkISize::Make(800, 600); |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void onDraw(SkCanvas* canvas) { | 74 virtual void onDraw(SkCanvas* canvas) { |
| 75 this->init(); | 75 this->init(); |
| 76 SkIRect scrollCenterRegion = SkIRect::MakeXYWH( | 76 SkIRect scrollCenterRegion = SkIRect::MakeXYWH( |
| 77 quarterWidth, quarterHeight, quarterWidth*2+1, quarterHeight*2+1); | 77 quarterWidth, quarterHeight, quarterWidth*2+1, quarterHeight*2+1); |
| 78 int x = quarterWidth; | 78 int x = quarterWidth; |
| 79 int y = quarterHeight; | 79 int y = quarterHeight; |
| 80 int xSpacing = quarterWidth * 20; | 80 int xSpacing = quarterWidth * 20; |
| 81 int ySpacing = quarterHeight * 16; | 81 int ySpacing = quarterHeight * 16; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 static const int quarterHeight = 14; | 149 static const int quarterHeight = 14; |
| 150 SkBitmap origBitmap; | 150 SkBitmap origBitmap; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 ////////////////////////////////////////////////////////////////////////////// | 153 ////////////////////////////////////////////////////////////////////////////// |
| 154 | 154 |
| 155 static GM* MyFactory(void*) { return new BitmapScrollGM; } | 155 static GM* MyFactory(void*) { return new BitmapScrollGM; } |
| 156 static GMRegistry reg(MyFactory); | 156 static GMRegistry reg(MyFactory); |
| 157 | 157 |
| 158 } | 158 } |
| OLD | NEW |