OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 skiagm::GM::DrawGpuOnlyMessage(canvas); | 75 skiagm::GM::DrawGpuOnlyMessage(canvas); |
76 return; | 76 return; |
77 } | 77 } |
78 | 78 |
79 GrContext* context = canvas->getGrContext(); | 79 GrContext* context = canvas->getGrContext(); |
80 if (!context) { | 80 if (!context) { |
81 return; | 81 return; |
82 } | 82 } |
83 | 83 |
84 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp, | 84 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp, |
85 GrTextureParams
::ClampNoFilter())); | 85 GrTextureParams
::ClampNoFilter(), |
| 86 SkSourceGammaTr
eatment::kRespect)); |
86 if (!texture) { | 87 if (!texture) { |
87 return; | 88 return; |
88 } | 89 } |
89 | 90 |
90 SkTArray<SkMatrix> textureMatrices; | 91 SkTArray<SkMatrix> textureMatrices; |
91 textureMatrices.push_back().setIDiv(texture->width(), texture->height())
; | 92 textureMatrices.push_back().setIDiv(texture->width(), texture->height())
; |
92 textureMatrices.push_back() = textureMatrices[0]; | 93 textureMatrices.push_back() = textureMatrices[0]; |
93 textureMatrices.back().postScale(1.5f, 0.85f); | 94 textureMatrices.back().postScale(1.5f, 0.85f); |
94 textureMatrices.push_back() = textureMatrices[0]; | 95 textureMatrices.push_back() = textureMatrices[0]; |
95 textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture->
height() / 2.f); | 96 textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture->
height() / 2.f); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 }; | 150 }; |
150 | 151 |
151 // Windows builds did not like SkScalar initialization in class :( | 152 // Windows builds did not like SkScalar initialization in class :( |
152 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 153 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
153 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 154 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
154 | 155 |
155 DEF_GM(return new TextureDomainEffect;) | 156 DEF_GM(return new TextureDomainEffect;) |
156 } | 157 } |
157 | 158 |
158 #endif | 159 #endif |
OLD | NEW |