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

Side by Side Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 791743003: Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: more windows 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 | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrDistanceFieldTextContext.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 2011 Google Inc. 2 * Copyright 2011 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 #include "GrDefaultPathRenderer.h" 8 #include "GrDefaultPathRenderer.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } else { 491 } else {
492 bounds = path.getBounds(); 492 bounds = path.getBounds();
493 } 493 }
494 GrDrawTarget::AutoGeometryPush agp(target); 494 GrDrawTarget::AutoGeometryPush agp(target);
495 target->drawSimpleRect(drawState, color, bounds); 495 target->drawSimpleRect(drawState, color, bounds);
496 } else { 496 } else {
497 if (passCount > 1) { 497 if (passCount > 1) {
498 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); 498 drawState->enableState(GrDrawState::kNoColorWrites_StateBit);
499 } 499 }
500 GrDrawState::AutoRestoreEffects are(drawState); 500 GrDrawState::AutoRestoreEffects are(drawState);
501 drawState->setGeometryProcessor( 501 SkAutoTUnref<const GrGeometryProcessor> gp(
502 GrDefaultGeoProcFactory::Create(color, 502 GrDefaultGeoProcFactory::Create(color,
503 GrDefaultGeoProcFactory::kPo sition_GPType, 503 GrDefaultGeoProcFactory::kPo sition_GPType,
504 newCoverage))->unref(); 504 false,
505 newCoverage));
505 if (indexCnt) { 506 if (indexCnt) {
506 target->drawIndexed(drawState, 507 target->drawIndexed(drawState,
508 gp,
507 primType, 509 primType,
508 0, 510 0,
509 0, 511 0,
510 vertexCnt, 512 vertexCnt,
511 indexCnt, 513 indexCnt,
512 &devBounds); 514 &devBounds);
513 } else { 515 } else {
514 target->drawNonIndexed(drawState, primType, 0, vertexCnt, &devBo unds); 516 target->drawNonIndexed(drawState, gp, primType, 0, vertexCnt, &d evBounds);
515 } 517 }
516 } 518 }
517 } 519 }
518 return true; 520 return true;
519 } 521 }
520 522
521 bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target, 523 bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target,
522 const GrDrawState* drawState, 524 const GrDrawState* drawState,
523 const SkPath& path, 525 const SkPath& path,
524 const SkStrokeRec& stroke, 526 const SkStrokeRec& stroke,
(...skipping 20 matching lines...) Expand all
545 } 547 }
546 548
547 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target, 549 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target,
548 GrDrawState* drawState, 550 GrDrawState* drawState,
549 const SkPath& path, 551 const SkPath& path,
550 const SkStrokeRec& stroke) { 552 const SkStrokeRec& stroke) {
551 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); 553 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType());
552 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); 554 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType());
553 this->internalDrawPath(target, drawState, GrColor_WHITE, path, stroke, true) ; 555 this->internalDrawPath(target, drawState, GrColor_WHITE, path, stroke, true) ;
554 } 556 }
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698