| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrOptDrawState.h" | 8 #include "GrOptDrawState.h" |
| 9 | 9 |
| 10 #include "GrDrawState.h" | 10 #include "GrDrawState.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // indicate that this can be skipped. | 66 // indicate that this can be skipped. |
| 67 fFlags = 0; | 67 fFlags = 0; |
| 68 fDrawFace = GrDrawState::kInvalid_DrawFace; | 68 fDrawFace = GrDrawState::kInvalid_DrawFace; |
| 69 fViewMatrix.reset(); | 69 fViewMatrix.reset(); |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 fRenderTarget.reset(drawState.fRenderTarget.get()); | 73 fRenderTarget.reset(drawState.fRenderTarget.get()); |
| 74 SkASSERT(fRenderTarget); | 74 SkASSERT(fRenderTarget); |
| 75 fScissorState = scissorState; | 75 fScissorState = scissorState; |
| 76 fViewMatrix = drawState.getViewMatrix(); | 76 fViewMatrix = fPrimitiveProcessor->viewMatrix(); |
| 77 fStencilSettings = drawState.getStencil(); | 77 fStencilSettings = drawState.getStencil(); |
| 78 fDrawFace = drawState.getDrawFace(); | 78 fDrawFace = drawState.getDrawFace(); |
| 79 // TODO move this out of optDrawState | 79 // TODO move this out of optDrawState |
| 80 if (dstCopy) { | 80 if (dstCopy) { |
| 81 fDstCopy = *dstCopy; | 81 fDstCopy = *dstCopy; |
| 82 } | 82 } |
| 83 | 83 |
| 84 fFlags = 0; | 84 fFlags = 0; |
| 85 if (drawState.isHWAntialias()) { | 85 if (drawState.isHWAntialias()) { |
| 86 fFlags |= kHWAA_Flag; | 86 fFlags |= kHWAA_Flag; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 206 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
| 207 return false; | 207 return false; |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 // Now update the GrPrimitiveProcessor's batch tracker | 211 // Now update the GrPrimitiveProcessor's batch tracker |
| 212 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); | 212 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| OLD | NEW |