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

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

Issue 452823002: Separate GL path rendering state from GrGpuGL to GrGLPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@00xx-cherrypick-pathrendering-class
Patch Set: Created 6 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
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return entry->fProgram; 197 return entry->fProgram;
198 } 198 }
199 199
200 //////////////////////////////////////////////////////////////////////////////// 200 ////////////////////////////////////////////////////////////////////////////////
201 201
202 void GrGpuGL::abandonResources(){ 202 void GrGpuGL::abandonResources(){
203 INHERITED::abandonResources(); 203 INHERITED::abandonResources();
204 fProgramCache->abandon(); 204 fProgramCache->abandon();
205 fHWProgramID = 0; 205 fHWProgramID = 0;
206 if (this->glCaps().pathRenderingSupport()) { 206 if (this->glCaps().pathRenderingSupport()) {
207 fPathRendering->abandonGpuResources(); 207 this->glPathRendering()->abandonGpuResources();
208 } 208 }
209 } 209 }
210 210
211 //////////////////////////////////////////////////////////////////////////////// 211 ////////////////////////////////////////////////////////////////////////////////
212 212
213 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) 213 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X)
214 214
215 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC opy) { 215 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC opy) {
216 const GrDrawState& drawState = this->getDrawState(); 216 const GrDrawState& drawState = this->getDrawState();
217 217
218 // GrGpu::setupClipAndFlushState should have already checked this and bailed if not true. 218 // GrGpu::setupClipAndFlushState should have already checked this and bailed if not true.
219 SkASSERT(NULL != drawState.getRenderTarget()); 219 SkASSERT(NULL != drawState.getRenderTarget());
220 220
221 if (kStencilPath_DrawType == type) { 221 if (kStencilPath_DrawType == type) {
222 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); 222 const GrRenderTarget* rt = this->getDrawState().getRenderTarget();
223 SkISize size; 223 SkISize size;
224 size.set(rt->width(), rt->height()); 224 size.set(rt->width(), rt->height());
225 this->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin()) ; 225 this->glPathRendering()->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin());
226 } else { 226 } else {
227 this->flushMiscFixedFunctionState(); 227 this->flushMiscFixedFunctionState();
228 228
229 GrBlendCoeff srcCoeff; 229 GrBlendCoeff srcCoeff;
230 GrBlendCoeff dstCoeff; 230 GrBlendCoeff dstCoeff;
231 GrDrawState::BlendOptFlags blendOpts = drawState.getBlendOpts(false, &sr cCoeff, &dstCoeff); 231 GrDrawState::BlendOptFlags blendOpts = drawState.getBlendOpts(false, &sr cCoeff, &dstCoeff);
232 if (GrDrawState::kSkipDraw_BlendOptFlag & blendOpts) { 232 if (GrDrawState::kSkipDraw_BlendOptFlag & blendOpts) {
233 return false; 233 return false;
234 } 234 }
235 235
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 GrGLAttribTypeToLayout(attribType).fType, 370 GrGLAttribTypeToLayout(attribType).fType,
371 GrGLAttribTypeToLayout(attribType).fNormalized, 371 GrGLAttribTypeToLayout(attribType).fNormalized,
372 stride, 372 stride,
373 reinterpret_cast<GrGLvoid*>( 373 reinterpret_cast<GrGLvoid*>(
374 vertexOffsetInBytes + vertexAttrib->fOffset)); 374 vertexOffsetInBytes + vertexAttrib->fOffset));
375 } 375 }
376 } 376 }
377 attribState->disableUnusedArrays(this, usedAttribArraysMask); 377 attribState->disableUnusedArrays(this, usedAttribArraysMask);
378 } 378 }
379 } 379 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698