Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 1404433002: Remove image usage type enum. Use GrTextureParams instead. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no gpu build Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/yuvtorgbeffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return; 79 return;
80 } 80 }
81 81
82 GrTestTarget tt; 82 GrTestTarget tt;
83 context->getTestTarget(&tt); 83 context->getTestTarget(&tt);
84 if (nullptr == tt.target()) { 84 if (nullptr == tt.target()) {
85 SkDEBUGFAIL("Couldn't get Gr test target."); 85 SkDEBUGFAIL("Couldn't get Gr test target.");
86 return; 86 return;
87 } 87 }
88 88
89 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp, nullptr)); 89 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp,
90 GrTextureParams ::ClampNoFilter()));
90 if (!texture) { 91 if (!texture) {
91 return; 92 return;
92 } 93 }
93 94
94 SkTArray<SkMatrix> textureMatrices; 95 SkTArray<SkMatrix> textureMatrices;
95 textureMatrices.push_back().setIDiv(texture->width(), texture->height()) ; 96 textureMatrices.push_back().setIDiv(texture->width(), texture->height()) ;
96 textureMatrices.push_back() = textureMatrices[0]; 97 textureMatrices.push_back() = textureMatrices[0];
97 textureMatrices.back().postScale(1.5f, 0.85f); 98 textureMatrices.back().postScale(1.5f, 0.85f);
98 textureMatrices.push_back() = textureMatrices[0]; 99 textureMatrices.push_back() = textureMatrices[0];
99 textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture-> height() / 2.f); 100 textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture-> height() / 2.f);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 }; 152 };
152 153
153 // Windows builds did not like SkScalar initialization in class :( 154 // Windows builds did not like SkScalar initialization in class :(
154 const SkScalar TextureDomainEffect::kDrawPad = 10.f; 155 const SkScalar TextureDomainEffect::kDrawPad = 10.f;
155 const SkScalar TextureDomainEffect::kTestPad = 10.f; 156 const SkScalar TextureDomainEffect::kTestPad = 10.f;
156 157
157 DEF_GM(return new TextureDomainEffect;) 158 DEF_GM(return new TextureDomainEffect;)
158 } 159 }
159 160
160 #endif 161 #endif
OLDNEW
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/yuvtorgbeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698