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

Side by Side Diff: gm/beziereffects.cpp

Issue 1988923002: Remove GrRenderTarget from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 6 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 | « no previous file | gm/bigrrectaaeffect.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 SkPaint boundsPaint; 186 SkPaint boundsPaint;
187 boundsPaint.setColor(0xff808080); 187 boundsPaint.setColor(0xff808080);
188 boundsPaint.setStrokeWidth(0); 188 boundsPaint.setStrokeWidth(0);
189 boundsPaint.setStyle(SkPaint::kStroke_Style); 189 boundsPaint.setStyle(SkPaint::kStroke_Style);
190 canvas->drawRect(bounds, boundsPaint); 190 canvas->drawRect(bounds, boundsPaint);
191 191
192 GrPipelineBuilder pipelineBuilder; 192 GrPipelineBuilder pipelineBuilder;
193 pipelineBuilder.setXPFactory( 193 pipelineBuilder.setXPFactory(
194 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref(); 194 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref();
195 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar get());
196 195
197 SkAutoTUnref<GrDrawBatch> batch( 196 SkAutoTUnref<GrDrawBatch> batch(
198 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq s, klmSigns[c])); 197 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq s, klmSigns[c]));
199 198
200 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch); 199 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch);
201 } 200 }
202 ++col; 201 ++col;
203 if (numCols == col) { 202 if (numCols == col) {
204 col = 0; 203 col = 0;
205 ++row; 204 ++row;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 317
319 SkPaint boundsPaint; 318 SkPaint boundsPaint;
320 boundsPaint.setColor(0xff808080); 319 boundsPaint.setColor(0xff808080);
321 boundsPaint.setStrokeWidth(0); 320 boundsPaint.setStrokeWidth(0);
322 boundsPaint.setStyle(SkPaint::kStroke_Style); 321 boundsPaint.setStyle(SkPaint::kStroke_Style);
323 canvas->drawRect(bounds, boundsPaint); 322 canvas->drawRect(bounds, boundsPaint);
324 323
325 GrPipelineBuilder pipelineBuilder; 324 GrPipelineBuilder pipelineBuilder;
326 pipelineBuilder.setXPFactory( 325 pipelineBuilder.setXPFactory(
327 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref(); 326 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref();
328 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar get());
329 327
330 SkAutoTUnref<GrDrawBatch> batch( 328 SkAutoTUnref<GrDrawBatch> batch(
331 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq s, 1.f)); 329 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq s, 1.f));
332 330
333 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch); 331 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch);
334 } 332 }
335 ++col; 333 ++col;
336 if (numCols == col) { 334 if (numCols == col) {
337 col = 0; 335 col = 0;
338 ++row; 336 ++row;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 524
527 SkPaint boundsPaint; 525 SkPaint boundsPaint;
528 boundsPaint.setColor(0xff808080); 526 boundsPaint.setColor(0xff808080);
529 boundsPaint.setStrokeWidth(0); 527 boundsPaint.setStrokeWidth(0);
530 boundsPaint.setStyle(SkPaint::kStroke_Style); 528 boundsPaint.setStyle(SkPaint::kStroke_Style);
531 canvas->drawRect(bounds, boundsPaint); 529 canvas->drawRect(bounds, boundsPaint);
532 530
533 GrPipelineBuilder pipelineBuilder; 531 GrPipelineBuilder pipelineBuilder;
534 pipelineBuilder.setXPFactory( 532 pipelineBuilder.setXPFactory(
535 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref(); 533 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref();
536 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar get());
537 534
538 GrPathUtils::QuadUVMatrix DevToUV(pts); 535 GrPathUtils::QuadUVMatrix DevToUV(pts);
539 536
540 SkAutoTUnref<GrDrawBatch> batch( 537 SkAutoTUnref<GrDrawBatch> batch(
541 new BezierQuadTestBatch(gp, bounds, color, DevToUV)); 538 new BezierQuadTestBatch(gp, bounds, color, DevToUV));
542 539
543 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch); 540 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch);
544 } 541 }
545 ++col; 542 ++col;
546 if (numCols == col) { 543 if (numCols == col) {
547 col = 0; 544 col = 0;
548 ++row; 545 ++row;
549 } 546 }
550 } 547 }
551 } 548 }
552 } 549 }
553 550
554 private: 551 private:
555 typedef GM INHERITED; 552 typedef GM INHERITED;
556 }; 553 };
557 554
558 DEF_GM(return new BezierCubicEffects;) 555 DEF_GM(return new BezierCubicEffects;)
559 DEF_GM(return new BezierConicEffects;) 556 DEF_GM(return new BezierConicEffects;)
560 DEF_GM(return new BezierQuadEffects;) 557 DEF_GM(return new BezierQuadEffects;)
561 } 558 }
562 559
563 #endif 560 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/bigrrectaaeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698