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

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

Issue 15780002: Replace GrDrawState::AutoDeviceCoordDraw with GrDrawState::AutoViewMatrixRestore::setIdentity(). s (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update based on comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawState.h » ('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 #include "GrDefaultPathRenderer.h" 9 #include "GrDefaultPathRenderer.h"
10 10
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 drawState->setDrawFace(drawFace[p]); 452 drawState->setDrawFace(drawFace[p]);
453 if (NULL != passes[p]) { 453 if (NULL != passes[p]) {
454 *drawState->stencil() = *passes[p]; 454 *drawState->stencil() = *passes[p];
455 } 455 }
456 456
457 if (lastPassIsBounds && (p == passCount-1)) { 457 if (lastPassIsBounds && (p == passCount-1)) {
458 if (!colorWritesWereDisabled) { 458 if (!colorWritesWereDisabled) {
459 drawState->disableState(GrDrawState::kNoColorWrites_StateBit); 459 drawState->disableState(GrDrawState::kNoColorWrites_StateBit);
460 } 460 }
461 GrRect bounds; 461 GrRect bounds;
462 GrDrawState::AutoDeviceCoordDraw adcd; 462 GrDrawState::AutoViewMatrixRestore avmr;
463 if (reverse) { 463 if (reverse) {
464 GrAssert(NULL != drawState->getRenderTarget()); 464 GrAssert(NULL != drawState->getRenderTarget());
465 // draw over the dev bounds (which will be the whole dst surface for inv fill). 465 // draw over the dev bounds (which will be the whole dst surface for inv fill).
466 bounds = devBounds; 466 bounds = devBounds;
467 SkMatrix vmi; 467 SkMatrix vmi;
468 // mapRect through persp matrix may not be correct 468 // mapRect through persp matrix may not be correct
469 if (!drawState->getViewMatrix().hasPerspective() && 469 if (!drawState->getViewMatrix().hasPerspective() &&
470 drawState->getViewInverse(&vmi)) { 470 drawState->getViewInverse(&vmi)) {
471 vmi.mapRect(&bounds); 471 vmi.mapRect(&bounds);
472 } else { 472 } else {
473 adcd.set(drawState); 473 avmr.setIdentity(drawState);
474 } 474 }
475 } else { 475 } else {
476 bounds = path.getBounds(); 476 bounds = path.getBounds();
477 } 477 }
478 GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::k Preserve_ASRInit); 478 GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::k Preserve_ASRInit);
479 target->drawSimpleRect(bounds, NULL); 479 target->drawSimpleRect(bounds, NULL);
480 } else { 480 } else {
481 if (passCount > 1) { 481 if (passCount > 1) {
482 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); 482 drawState->enableState(GrDrawState::kNoColorWrites_StateBit);
483 } 483 }
(...skipping 26 matching lines...) Expand all
510 false); 510 false);
511 } 511 }
512 512
513 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, 513 void GrDefaultPathRenderer::onStencilPath(const SkPath& path,
514 const SkStrokeRec& stroke, 514 const SkStrokeRec& stroke,
515 GrDrawTarget* target) { 515 GrDrawTarget* target) {
516 GrAssert(SkPath::kInverseEvenOdd_FillType != path.getFillType()); 516 GrAssert(SkPath::kInverseEvenOdd_FillType != path.getFillType());
517 GrAssert(SkPath::kInverseWinding_FillType != path.getFillType()); 517 GrAssert(SkPath::kInverseWinding_FillType != path.getFillType());
518 this->internalDrawPath(path, stroke, target, true); 518 this->internalDrawPath(path, stroke, target, true);
519 } 519 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698