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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 paint.setShader(SkGradientShader::CreateRadial( | 61 paint.setShader(SkGradientShader::CreateRadial( |
62 pt, radius, | 62 pt, radius, |
63 colors, pos, | 63 colors, pos, |
64 SK_ARRAY_COUNT(colors), | 64 SK_ARRAY_COUNT(colors), |
65 SkShader::kRepeat_TileMode, | 65 SkShader::kRepeat_TileMode, |
66 NULL, 0, &mat))->unref(); | 66 NULL, 0, &mat))->unref(); |
67 canvas.drawRect(rect, paint); | 67 canvas.drawRect(rect, paint); |
68 rect.inset(wScalar / 8, hScalar / 8); | 68 rect.inset(wScalar / 8, hScalar / 8); |
69 mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4); | 69 mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4); |
70 } | 70 } |
71 bm->setImmutable(); | |
reed1
2014/05/02 14:11:00
// mark as immutable to be nicer to backends, so t
mtklein
2014/05/02 14:14:00
Done.
| |
71 } | 72 } |
72 | 73 |
73 static const int gSize = 1024; | 74 static const int gSize = 1024; |
74 | 75 |
75 class DrawBitmapRectGM : public GM { | 76 class DrawBitmapRectGM : public GM { |
76 public: | 77 public: |
77 DrawBitmapRectGM() { | 78 DrawBitmapRectGM() { |
78 } | 79 } |
79 | 80 |
80 SkBitmap fLargeBitmap; | 81 SkBitmap fLargeBitmap; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 | 175 |
175 private: | 176 private: |
176 typedef GM INHERITED; | 177 typedef GM INHERITED; |
177 }; | 178 }; |
178 | 179 |
179 ////////////////////////////////////////////////////////////////////////////// | 180 ////////////////////////////////////////////////////////////////////////////// |
180 | 181 |
181 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } | 182 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } |
182 static GMRegistry reg(MyFactory); | 183 static GMRegistry reg(MyFactory); |
183 } | 184 } |
OLD | NEW |