| 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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 DrawBitmapRectGM() { | 79 DrawBitmapRectGM() { |
| 80 } | 80 } |
| 81 | 81 |
| 82 SkBitmap fLargeBitmap; | 82 SkBitmap fLargeBitmap; |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 SkString onShortName() { | 85 SkString onShortName() { |
| 86 return SkString("drawbitmaprect"); | 86 return SkString("drawbitmaprect"); |
| 87 } | 87 } |
| 88 | 88 |
| 89 SkISize onISize() { return make_isize(gSize, gSize); } | 89 SkISize onISize() { return SkISize::Make(gSize, gSize); } |
| 90 | 90 |
| 91 virtual void onDraw(SkCanvas* canvas) { | 91 virtual void onDraw(SkCanvas* canvas) { |
| 92 static const int kBmpSize = 2048; | 92 static const int kBmpSize = 2048; |
| 93 if (fLargeBitmap.isNull()) { | 93 if (fLargeBitmap.isNull()) { |
| 94 makebm(&fLargeBitmap, kBmpSize, kBmpSize); | 94 makebm(&fLargeBitmap, kBmpSize, kBmpSize); |
| 95 } | 95 } |
| 96 SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; | 96 SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; |
| 97 static const int kMaxSrcRectSize = 1 << (SkNextLog2(kBmpSize) + 2); | 97 static const int kMaxSrcRectSize = 1 << (SkNextLog2(kBmpSize) + 2); |
| 98 | 98 |
| 99 static const int kPadX = 30; | 99 static const int kPadX = 30; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 private: | 177 private: |
| 178 typedef GM INHERITED; | 178 typedef GM INHERITED; |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 ////////////////////////////////////////////////////////////////////////////// | 181 ////////////////////////////////////////////////////////////////////////////// |
| 182 | 182 |
| 183 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } | 183 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } |
| 184 static GMRegistry reg(MyFactory); | 184 static GMRegistry reg(MyFactory); |
| 185 } | 185 } |
| OLD | NEW |