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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 783763002: Initial CL to move color / coverage off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@no-static-gp
Patch Set: bug fix Created 6 years 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(viewMatrix);
134 drawState.setRenderTarget(rt); 134 drawState.setRenderTarget(rt);
135 drawState.setColor(0xffffffff);
136 drawState.addColorProcessor(fp); 135 drawState.addColorProcessor(fp);
137 136
138 tt.target()->drawSimpleRect(&drawState, renderRect); 137 tt.target()->drawSimpleRect(&drawState, GrColor_WHITE, rende rRect);
139 x += renderRect.width() + kTestPad; 138 x += renderRect.width() + kTestPad;
140 } 139 }
141 y += renderRect.height() + kTestPad; 140 y += renderRect.height() + kTestPad;
142 } 141 }
143 } 142 }
144 } 143 }
145 144
146 private: 145 private:
147 static const SkScalar kDrawPad; 146 static const SkScalar kDrawPad;
148 static const SkScalar kTestPad; 147 static const SkScalar kTestPad;
149 static const int kTargetWidth = 100; 148 static const int kTargetWidth = 100;
150 static const int kTargetHeight = 100; 149 static const int kTargetHeight = 100;
151 SkBitmap fBmp; 150 SkBitmap fBmp;
152 151
153 typedef GM INHERITED; 152 typedef GM INHERITED;
154 }; 153 };
155 154
156 // Windows builds did not like SkScalar initialization in class :( 155 // Windows builds did not like SkScalar initialization in class :(
157 const SkScalar TextureDomainEffect::kDrawPad = 10.f; 156 const SkScalar TextureDomainEffect::kDrawPad = 10.f;
158 const SkScalar TextureDomainEffect::kTestPad = 10.f; 157 const SkScalar TextureDomainEffect::kTestPad = 10.f;
159 158
160 DEF_GM( return SkNEW(TextureDomainEffect); ) 159 DEF_GM( return SkNEW(TextureDomainEffect); )
161 } 160 }
162 161
163 #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