OLD | NEW |
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 "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
9 | 9 |
10 #include "GrAllocator.h" | 10 #include "GrAllocator.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // set RT adjustment | 128 // set RT adjustment |
129 const GrRenderTarget* rt = pipeline.getRenderTarget(); | 129 const GrRenderTarget* rt = pipeline.getRenderTarget(); |
130 SkISize size; | 130 SkISize size; |
131 size.set(rt->width(), rt->height()); | 131 size.set(rt->width(), rt->height()); |
132 if (!primProc.isPathRendering()) { | 132 if (!primProc.isPathRendering()) { |
133 if (fRenderTargetState.fRenderTargetOrigin != rt->origin() || | 133 if (fRenderTargetState.fRenderTargetOrigin != rt->origin() || |
134 fRenderTargetState.fRenderTargetSize != size) { | 134 fRenderTargetState.fRenderTargetSize != size) { |
135 fRenderTargetState.fRenderTargetSize = size; | 135 fRenderTargetState.fRenderTargetSize = size; |
136 fRenderTargetState.fRenderTargetOrigin = rt->origin(); | 136 fRenderTargetState.fRenderTargetOrigin = rt->origin(); |
137 | 137 |
138 GrGLfloat rtAdjustmentVec[4]; | 138 float rtAdjustmentVec[4]; |
139 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); | 139 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); |
140 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni,
1, rtAdjustmentVec); | 140 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni,
1, rtAdjustmentVec); |
141 } | 141 } |
142 } else { | 142 } else { |
143 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); | 143 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); |
144 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); | 144 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); |
145 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), | 145 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), |
146 size, rt->origin()); | 146 size, rt->origin()); |
147 } | 147 } |
148 } | 148 } |
OLD | NEW |