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

Side by Side Diff: src/gpu/GrInOrderDrawBuffer.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/GrDrawTarget.cpp ('k') | src/gpu/GrOvalRenderer.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 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 9
10 #include "GrInOrderDrawBuffer.h" 10 #include "GrInOrderDrawBuffer.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 SkMatrix combinedMatrix; 151 SkMatrix combinedMatrix;
152 if (NULL != matrix) { 152 if (NULL != matrix) {
153 combinedMatrix = *matrix; 153 combinedMatrix = *matrix;
154 } else { 154 } else {
155 combinedMatrix.reset(); 155 combinedMatrix.reset();
156 } 156 }
157 combinedMatrix.postConcat(drawState->getViewMatrix()); 157 combinedMatrix.postConcat(drawState->getViewMatrix());
158 // When the caller has provided an explicit source rect for a stage then we don't want to 158 // When the caller has provided an explicit source rect for a stage then we don't want to
159 // modify that stage's matrix. Otherwise if the effect is generating its sou rce rect from 159 // modify that stage's matrix. Otherwise if the effect is generating its sou rce rect from
160 // the vertex positions then we have to account for the view matrix change. 160 // the vertex positions then we have to account for the view matrix change.
161 GrDrawState::AutoDeviceCoordDraw adcd(drawState); 161 GrDrawState::AutoViewMatrixRestore avmr;
162 if (!adcd.succeeded()) { 162 if (!avmr.setIdentity(drawState)) {
163 return; 163 return;
164 } 164 }
165 165
166 size_t vsize = drawState->getVertexSize(); 166 size_t vsize = drawState->getVertexSize();
167 167
168 geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom , vsize); 168 geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom , vsize);
169 combinedMatrix.mapPointsWithStride(geo.positions(), vsize, 4); 169 combinedMatrix.mapPointsWithStride(geo.positions(), vsize, 4);
170 170
171 SkRect devBounds; 171 SkRect devBounds;
172 // since we already computed the dev verts, set the bounds hint. This will h elp us avoid 172 // since we already computed the dev verts, set the bounds hint. This will h elp us avoid
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 fCmds.push_back(kCopySurface_Cmd); 816 fCmds.push_back(kCopySurface_Cmd);
817 return &fCopySurfaces.push_back(); 817 return &fCopySurfaces.push_back();
818 } 818 }
819 819
820 820
821 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { 821 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) {
822 INHERITED::clipWillBeSet(newClipData); 822 INHERITED::clipWillBeSet(newClipData);
823 fClipSet = true; 823 fClipSet = true;
824 fClipProxyState = kUnknown_ClipProxyState; 824 fClipProxyState = kUnknown_ClipProxyState;
825 } 825 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698