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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 years, 5 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/rrects.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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp.width()), 115 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp.width()),
116 SkIntToScalar(fBmp.height())); 116 SkIntToScalar(fBmp.height()));
117 renderRect.outset(kDrawPad, kDrawPad); 117 renderRect.outset(kDrawPad, kDrawPad);
118 118
119 SkScalar y = kDrawPad + kTestPad; 119 SkScalar y = kDrawPad + kTestPad;
120 for (int tm = 0; tm < textureMatrices.count(); ++tm) { 120 for (int tm = 0; tm < textureMatrices.count(); ++tm) {
121 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { 121 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) {
122 SkScalar x = kDrawPad + kTestPad; 122 SkScalar x = kDrawPad + kTestPad;
123 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { 123 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) {
124 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; 124 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m;
125 SkAutoTUnref<GrEffectRef> effect( 125 SkAutoTUnref<GrEffect> effect(
126 GrTextureDomainEffect::Create(texture, textureMatrices[t m], 126 GrTextureDomainEffect::Create(texture, textureMatrices[t m],
127 GrTextureDomain::MakeTexelDomain (texture, 127 GrTextureDomain::MakeTexelDomain (texture,
128 texelDomains[d]), 128 texelDomains[d]),
129 mode, GrTextureParams::kNone_Fil terMode)); 129 mode, GrTextureParams::kNone_Fil terMode));
130 130
131 if (!effect) { 131 if (!effect) {
132 continue; 132 continue;
133 } 133 }
134 SkMatrix viewMatrix; 134 SkMatrix viewMatrix;
135 viewMatrix.setTranslate(x, y); 135 viewMatrix.setTranslate(x, y);
(...skipping 14 matching lines...) Expand all
150 private: 150 private:
151 SkBitmap fBmp; 151 SkBitmap fBmp;
152 152
153 typedef GM INHERITED; 153 typedef GM INHERITED;
154 }; 154 };
155 155
156 DEF_GM( return SkNEW(TextureDomainEffect); ) 156 DEF_GM( return SkNEW(TextureDomainEffect); )
157 } 157 }
158 158
159 #endif 159 #endif
OLDNEW
« no previous file with comments | « gm/rrects.cpp ('k') | gm/yuvtorgbeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698