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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 815553003: Move ViewMatrix off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@remove-fragment-stage
Patch Set: more cleaning Created 5 years, 11 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 GrTextureDomainEffect::Create(texture, textureMatrices[t m], 123 GrTextureDomainEffect::Create(texture, textureMatrices[t m],
124 GrTextureDomain::MakeTexelDomain (texture, 124 GrTextureDomain::MakeTexelDomain (texture,
125 texelDomains[d]), 125 texelDomains[d]),
126 mode, GrTextureParams::kNone_Fil terMode)); 126 mode, GrTextureParams::kNone_Fil terMode));
127 127
128 if (!fp) { 128 if (!fp) {
129 continue; 129 continue;
130 } 130 }
131 SkMatrix viewMatrix; 131 SkMatrix viewMatrix;
132 viewMatrix.setTranslate(x, y); 132 viewMatrix.setTranslate(x, y);
133 GrDrawState drawState(viewMatrix); 133 GrDrawState drawState;
134 drawState.setRenderTarget(rt); 134 drawState.setRenderTarget(rt);
135 drawState.addColorProcessor(fp); 135 drawState.addColorProcessor(fp);
136 136
137 tt.target()->drawSimpleRect(&drawState, GrColor_WHITE, rende rRect); 137 tt.target()->drawSimpleRect(&drawState, GrColor_WHITE, viewM atrix, renderRect);
138 x += renderRect.width() + kTestPad; 138 x += renderRect.width() + kTestPad;
139 } 139 }
140 y += renderRect.height() + kTestPad; 140 y += renderRect.height() + kTestPad;
141 } 141 }
142 } 142 }
143 } 143 }
144 144
145 private: 145 private:
146 static const SkScalar kDrawPad; 146 static const SkScalar kDrawPad;
147 static const SkScalar kTestPad; 147 static const SkScalar kTestPad;
148 static const int kTargetWidth = 100; 148 static const int kTargetWidth = 100;
149 static const int kTargetHeight = 100; 149 static const int kTargetHeight = 100;
150 SkBitmap fBmp; 150 SkBitmap fBmp;
151 151
152 typedef GM INHERITED; 152 typedef GM INHERITED;
153 }; 153 };
154 154
155 // Windows builds did not like SkScalar initialization in class :( 155 // Windows builds did not like SkScalar initialization in class :(
156 const SkScalar TextureDomainEffect::kDrawPad = 10.f; 156 const SkScalar TextureDomainEffect::kDrawPad = 10.f;
157 const SkScalar TextureDomainEffect::kTestPad = 10.f; 157 const SkScalar TextureDomainEffect::kTestPad = 10.f;
158 158
159 DEF_GM( return SkNEW(TextureDomainEffect); ) 159 DEF_GM( return SkNEW(TextureDomainEffect); )
160 } 160 }
161 161
162 #endif 162 #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