OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 return SkString("texture_domain_effect"); | 34 return SkString("texture_domain_effect"); |
35 } | 35 } |
36 | 36 |
37 SkISize onISize() SK_OVERRIDE { | 37 SkISize onISize() SK_OVERRIDE { |
38 const SkScalar canvasWidth = kDrawPad + | 38 const SkScalar canvasWidth = kDrawPad + |
39 (kTargetWidth + 2 * kDrawPad) * GrTextureDomain::kModeCount + | 39 (kTargetWidth + 2 * kDrawPad) * GrTextureDomain::kModeCount + |
40 kTestPad * GrTextureDomain::kModeCount; | 40 kTestPad * GrTextureDomain::kModeCount; |
41 return SkISize::Make(SkScalarCeilToInt(canvasWidth), 800); | 41 return SkISize::Make(SkScalarCeilToInt(canvasWidth), 800); |
42 } | 42 } |
43 | 43 |
44 uint32_t onGetFlags() const SK_OVERRIDE { | |
45 // This is a GPU-specific GM. | |
46 return kGPUOnly_Flag; | |
47 } | |
48 | |
49 void onOnceBeforeDraw() SK_OVERRIDE { | 44 void onOnceBeforeDraw() SK_OVERRIDE { |
50 fBmp.allocN32Pixels(kTargetWidth, kTargetHeight); | 45 fBmp.allocN32Pixels(kTargetWidth, kTargetHeight); |
51 SkCanvas canvas(fBmp); | 46 SkCanvas canvas(fBmp); |
52 canvas.clear(0x00000000); | 47 canvas.clear(0x00000000); |
53 SkPaint paint; | 48 SkPaint paint; |
54 | 49 |
55 SkColor colors1[] = { SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorGRAY }; | 50 SkColor colors1[] = { SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorGRAY }; |
56 paint.setShader(SkGradientShader::CreateSweep(65.f, 75.f, colors1, | 51 paint.setShader(SkGradientShader::CreateSweep(65.f, 75.f, colors1, |
57 NULL, SK_ARRAY_COUNT(color
s1)))->unref(); | 52 NULL, SK_ARRAY_COUNT(color
s1)))->unref(); |
58 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, | 53 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 }; | 149 }; |
155 | 150 |
156 // Windows builds did not like SkScalar initialization in class :( | 151 // Windows builds did not like SkScalar initialization in class :( |
157 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 152 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
158 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 153 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
159 | 154 |
160 DEF_GM( return SkNEW(TextureDomainEffect); ) | 155 DEF_GM( return SkNEW(TextureDomainEffect); ) |
161 } | 156 } |
162 | 157 |
163 #endif | 158 #endif |
OLD | NEW |