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

Side by Side Diff: gm/texdata.cpp

Issue 18686007: Make GrPaint have a variable sized array of color and coverage stages rather than a fixed size. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rob's comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('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 2011 Google Inc. 3 * Copyright 2011 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 vm.setRotate(90 * SK_Scalar1, 106 vm.setRotate(90 * SK_Scalar1,
107 S * SK_Scalar1, 107 S * SK_Scalar1,
108 S * SK_Scalar1); 108 S * SK_Scalar1);
109 } else { 109 } else {
110 vm.reset(); 110 vm.reset();
111 } 111 }
112 ctx->setMatrix(vm); 112 ctx->setMatrix(vm);
113 SkMatrix tm; 113 SkMatrix tm;
114 tm = vm; 114 tm = vm;
115 tm.postIDiv(2*S, 2*S); 115 tm.postIDiv(2*S, 2*S);
116 paint.colorStage(0)->setEffect(GrSimpleTextureEffect::Create(tex ture, tm))->unref(); 116 paint.addColorTextureEffect(texture, tm);
117 117
118 ctx->drawRect(paint, GrRect::MakeWH(2*S, 2*S)); 118 ctx->drawRect(paint, GrRect::MakeWH(2*S, 2*S));
119 119
120 // now update the lower right of the texture in first pass 120 // now update the lower right of the texture in first pass
121 // or upper right in second pass 121 // or upper right in second pass
122 offset = 0; 122 offset = 0;
123 for (int y = 0; y < S; ++y) { 123 for (int y = 0; y < S; ++y) {
124 for (int x = 0; x < S; ++x) { 124 for (int x = 0; x < S; ++x) {
125 gTextureData[offset + y * stride + x] = 125 gTextureData[offset + y * stride + x] =
126 ((x + y) % 2) ? (i ? green : red) : blue; 126 ((x + y) % 2) ? (i ? green : red) : blue;
(...skipping 12 matching lines...) Expand all
139 }; 139 };
140 140
141 ////////////////////////////////////////////////////////////////////////////// 141 //////////////////////////////////////////////////////////////////////////////
142 142
143 static GM* MyFactory(void*) { return new TexDataGM; } 143 static GM* MyFactory(void*) { return new TexDataGM; }
144 static GMRegistry reg(MyFactory); 144 static GMRegistry reg(MyFactory);
145 145
146 } 146 }
147 147
148 #endif 148 #endif
OLDNEW
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698