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

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

Issue 1541903002: added support for PLS path rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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
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 "GrGLProgram.h" 8 #include "GrGLProgram.h"
9 9
10 #include "GrAllocator.h" 10 #include "GrAllocator.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 SkTArray<const GrTextureAccess*>* textureBindings) { 82 SkTArray<const GrTextureAccess*>* textureBindings) {
83 this->setRenderTargetState(primProc, pipeline); 83 this->setRenderTargetState(primProc, pipeline);
84 84
85 // we set the textures, and uniforms for installed processors in a generic w ay, but subclasses 85 // we set the textures, and uniforms for installed processors in a generic w ay, but subclasses
86 // of GLProgram determine how to set coord transforms 86 // of GLProgram determine how to set coord transforms
87 fGeometryProcessor->fGLProc->setData(fProgramDataManager, primProc); 87 fGeometryProcessor->fGLProc->setData(fProgramDataManager, primProc);
88 append_texture_bindings(fGeometryProcessor.get(), primProc, textureBindings) ; 88 append_texture_bindings(fGeometryProcessor.get(), primProc, textureBindings) ;
89 89
90 this->setFragmentData(primProc, pipeline, textureBindings); 90 this->setFragmentData(primProc, pipeline, textureBindings);
91 91
92 const GrXferProcessor& xp = pipeline.getXferProcessor(); 92 if (primProc.getPixelLocalStorageState() != GrPixelLocalStorageState::kDraw_ State) {
93 fXferProcessor->fGLProc->setData(fProgramDataManager, xp); 93 const GrXferProcessor& xp = pipeline.getXferProcessor();
94 append_texture_bindings(fXferProcessor.get(), xp, textureBindings); 94 fXferProcessor->fGLProc->setData(fProgramDataManager, xp);
95 append_texture_bindings(fXferProcessor.get(), xp, textureBindings);
96 }
95 } 97 }
96 98
97 void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc, 99 void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc,
98 const GrPipeline& pipeline, 100 const GrPipeline& pipeline,
99 SkTArray<const GrTextureAccess*>* textureBindi ngs) { 101 SkTArray<const GrTextureAccess*>* textureBindi ngs) {
100 int numProcessors = fFragmentProcessors->fProcs.count(); 102 int numProcessors = fFragmentProcessors->fProcs.count();
101 for (int i = 0; i < numProcessors; ++i) { 103 for (int i = 0; i < numProcessors; ++i) {
102 const GrFragmentProcessor& processor = pipeline.getFragmentProcessor(i); 104 const GrFragmentProcessor& processor = pipeline.getFragmentProcessor(i);
103 fFragmentProcessors->fProcs[i]->fGLProc->setData(fProgramDataManager, pr ocessor); 105 fFragmentProcessors->fProcs[i]->fGLProc->setData(fProgramDataManager, pr ocessor);
104 this->setTransformData(primProc, 106 this->setTransformData(primProc,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); 142 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec);
141 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec); 143 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec);
142 } 144 }
143 } else { 145 } else {
144 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); 146 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport());
145 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); 147 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>();
146 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), 148 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(),
147 size, rt->origin()); 149 size, rt->origin());
148 } 150 }
149 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698