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

Side by Side Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 22176002: Actually flush the path stencil transform when the matrix changes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | no next file » | 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 "GrGpuGL.h" 8 #include "GrGpuGL.h"
9 9
10 #include "GrEffect.h" 10 #include "GrEffect.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) 204 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X)
205 205
206 void GrGpuGL::flushPathStencilMatrix() { 206 void GrGpuGL::flushPathStencilMatrix() {
207 const SkMatrix& viewMatrix = this->getDrawState().getViewMatrix(); 207 const SkMatrix& viewMatrix = this->getDrawState().getViewMatrix();
208 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); 208 const GrRenderTarget* rt = this->getDrawState().getRenderTarget();
209 SkISize size; 209 SkISize size;
210 size.set(rt->width(), rt->height()); 210 size.set(rt->width(), rt->height());
211 const SkMatrix& vm = this->getDrawState().getViewMatrix(); 211 const SkMatrix& vm = this->getDrawState().getViewMatrix();
212 212
213 if (fHWPathStencilMatrixState.fRenderTargetOrigin != rt->origin() || 213 if (fHWPathStencilMatrixState.fRenderTargetOrigin != rt->origin() ||
214 fHWPathStencilMatrixState.fViewMatrix.cheapEqualTo(viewMatrix) || 214 !fHWPathStencilMatrixState.fViewMatrix.cheapEqualTo(viewMatrix) ||
215 fHWPathStencilMatrixState.fRenderTargetSize!= size) { 215 fHWPathStencilMatrixState.fRenderTargetSize!= size) {
216 // rescale the coords from skia's "device" coords to GL's normalized coo rds, 216 // rescale the coords from skia's "device" coords to GL's normalized coo rds,
217 // and perform a y-flip if required. 217 // and perform a y-flip if required.
218 SkMatrix m; 218 SkMatrix m;
219 if (kBottomLeft_GrSurfaceOrigin == rt->origin()) { 219 if (kBottomLeft_GrSurfaceOrigin == rt->origin()) {
220 m.setScale(SkIntToScalar(2) / rt->width(), SkIntToScalar(-2) / rt->h eight()); 220 m.setScale(SkIntToScalar(2) / rt->width(), SkIntToScalar(-2) / rt->h eight());
221 m.postTranslate(-SK_Scalar1, SK_Scalar1); 221 m.postTranslate(-SK_Scalar1, SK_Scalar1);
222 } else { 222 } else {
223 m.setScale(SkIntToScalar(2) / rt->width(), SkIntToScalar(2) / rt->he ight()); 223 m.setScale(SkIntToScalar(2) / rt->width(), SkIntToScalar(2) / rt->he ight());
224 m.postTranslate(-SK_Scalar1, -SK_Scalar1); 224 m.postTranslate(-SK_Scalar1, -SK_Scalar1);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 GrGLAttribTypeToLayout(attribType).fCount, 399 GrGLAttribTypeToLayout(attribType).fCount,
400 GrGLAttribTypeToLayout(attribType).fType, 400 GrGLAttribTypeToLayout(attribType).fType,
401 GrGLAttribTypeToLayout(attribType).fNormalized, 401 GrGLAttribTypeToLayout(attribType).fNormalized,
402 stride, 402 stride,
403 reinterpret_cast<GrGLvoid*>( 403 reinterpret_cast<GrGLvoid*>(
404 vertexOffsetInBytes + vertexAttrib->fOffset)); 404 vertexOffsetInBytes + vertexAttrib->fOffset));
405 } 405 }
406 406
407 attribState->disableUnusedAttribArrays(this, usedAttribArraysMask); 407 attribState->disableUnusedAttribArrays(this, usedAttribArraysMask);
408 } 408 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698