| 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 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 fName.append(suffix); | 134 fName.append(suffix); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 DrawRectRectProc* fProc; | 138 DrawRectRectProc* fProc; |
| 139 SkBitmap fLargeBitmap; | 139 SkBitmap fLargeBitmap; |
| 140 SkAutoTUnref<SkImage> fImage; | 140 SkAutoTUnref<SkImage> fImage; |
| 141 SkString fName; | 141 SkString fName; |
| 142 | 142 |
| 143 protected: | 143 protected: |
| 144 SkString onShortName() SK_OVERRIDE { return fName; } | 144 SkString onShortName() override { return fName; } |
| 145 | 145 |
| 146 SkISize onISize() SK_OVERRIDE { return SkISize::Make(gSize, gSize); } | 146 SkISize onISize() override { return SkISize::Make(gSize, gSize); } |
| 147 | 147 |
| 148 void onOnceBeforeDraw() SK_OVERRIDE { | 148 void onOnceBeforeDraw() override { |
| 149 fImage.reset(makebm(&fLargeBitmap, gBmpSize, gBmpSize)); | 149 fImage.reset(makebm(&fLargeBitmap, gBmpSize, gBmpSize)); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 152 void onDraw(SkCanvas* canvas) override { |
| 153 SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; | 153 SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; |
| 154 static const int kMaxSrcRectSize = 1 << (SkNextLog2(gBmpSize) + 2); | 154 static const int kMaxSrcRectSize = 1 << (SkNextLog2(gBmpSize) + 2); |
| 155 | 155 |
| 156 static const int kPadX = 30; | 156 static const int kPadX = 30; |
| 157 static const int kPadY = 40; | 157 static const int kPadY = 40; |
| 158 SkPaint paint; | 158 SkPaint paint; |
| 159 paint.setAlpha(0x20); | 159 paint.setAlpha(0x20); |
| 160 canvas->drawBitmapRect(fLargeBitmap, NULL, | 160 canvas->drawBitmapRect(fLargeBitmap, NULL, |
| 161 SkRect::MakeWH(gSize * SK_Scalar1, | 161 SkRect::MakeWH(gSize * SK_Scalar1, |
| 162 gSize * SK_Scalar1), | 162 gSize * SK_Scalar1), |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 private: | 233 private: |
| 234 typedef skiagm::GM INHERITED; | 234 typedef skiagm::GM INHERITED; |
| 235 }; | 235 }; |
| 236 | 236 |
| 237 DEF_GM( return new DrawBitmapRectGM(canvasproc, NULL); ) | 237 DEF_GM( return new DrawBitmapRectGM(canvasproc, NULL); ) |
| 238 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) | 238 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) |
| 239 DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); ) | 239 DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); ) |
| OLD | NEW |