| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |