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

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

Issue 2358843002: Conditionally insert gl_PointSize into shaders. (Closed)
Patch Set: minor Created 4 years, 2 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/GrGLGpuProgramCache.cpp ('k') | src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp » ('j') | 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 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 "gl/GrGLPathRendering.h" 8 #include "gl/GrGLPathRendering.h"
9 #include "gl/GrGLUtil.h" 9 #include "gl/GrGLUtil.h"
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 if (glPath->shouldStroke()) { 143 if (glPath->shouldStroke()) {
144 GL_CALL(StencilStrokePath(glPath->pathID(), 0xffff, writeMask)); 144 GL_CALL(StencilStrokePath(glPath->pathID(), 0xffff, writeMask));
145 } 145 }
146 } 146 }
147 147
148 void GrGLPathRendering::onDrawPath(const GrPipeline& pipeline, 148 void GrGLPathRendering::onDrawPath(const GrPipeline& pipeline,
149 const GrPrimitiveProcessor& primProc, 149 const GrPrimitiveProcessor& primProc,
150 const GrStencilSettings& stencilPassSettings, 150 const GrStencilSettings& stencilPassSettings,
151 const GrPath* path) { 151 const GrPath* path) {
152 if (!this->gpu()->flushGLState(pipeline, primProc)) { 152 if (!this->gpu()->flushGLState(pipeline, primProc, false)) {
153 return; 153 return;
154 } 154 }
155 const GrGLPath* glPath = static_cast<const GrGLPath*>(path); 155 const GrGLPath* glPath = static_cast<const GrGLPath*>(path);
156 156
157 this->flushPathStencilSettings(stencilPassSettings); 157 this->flushPathStencilSettings(stencilPassSettings);
158 SkASSERT(!fHWPathStencilSettings.isTwoSided()); 158 SkASSERT(!fHWPathStencilSettings.isTwoSided());
159 159
160 GrGLenum fillMode = 160 GrGLenum fillMode =
161 gr_stencil_op_to_gl_path_rendering_fill_mode(fHWPathStencilSettings.fron t().fPassOp); 161 gr_stencil_op_to_gl_path_rendering_fill_mode(fHWPathStencilSettings.fron t().fPassOp);
162 GrGLint writeMask = fHWPathStencilSettings.front().fWriteMask; 162 GrGLint writeMask = fHWPathStencilSettings.front().fWriteMask;
(...skipping 11 matching lines...) Expand all
174 } 174 }
175 175
176 void GrGLPathRendering::onDrawPaths(const GrPipeline& pipeline, 176 void GrGLPathRendering::onDrawPaths(const GrPipeline& pipeline,
177 const GrPrimitiveProcessor& primProc, 177 const GrPrimitiveProcessor& primProc,
178 const GrStencilSettings& stencilPassSettings , 178 const GrStencilSettings& stencilPassSettings ,
179 const GrPathRange* pathRange, const void* in dices, 179 const GrPathRange* pathRange, const void* in dices,
180 PathIndexType indexType, const float transfo rmValues[], 180 PathIndexType indexType, const float transfo rmValues[],
181 PathTransformType transformType, int count) { 181 PathTransformType transformType, int count) {
182 SkDEBUGCODE(verify_floats(transformValues, gXformType2ComponentCount[transfo rmType] * count)); 182 SkDEBUGCODE(verify_floats(transformValues, gXformType2ComponentCount[transfo rmType] * count));
183 183
184 if (!this->gpu()->flushGLState(pipeline, primProc)) { 184 if (!this->gpu()->flushGLState(pipeline, primProc, false)) {
185 return; 185 return;
186 } 186 }
187 this->flushPathStencilSettings(stencilPassSettings); 187 this->flushPathStencilSettings(stencilPassSettings);
188 SkASSERT(!fHWPathStencilSettings.isTwoSided()); 188 SkASSERT(!fHWPathStencilSettings.isTwoSided());
189 189
190 190
191 const GrGLPathRange* glPathRange = static_cast<const GrGLPathRange*>(pathRan ge); 191 const GrGLPathRange* glPathRange = static_cast<const GrGLPathRange*>(pathRan ge);
192 192
193 GrGLenum fillMode = 193 GrGLenum fillMode =
194 gr_stencil_op_to_gl_path_rendering_fill_mode(fHWPathStencilSettings.fron t().fPassOp); 194 gr_stencil_op_to_gl_path_rendering_fill_mode(fHWPathStencilSettings.fron t().fPassOp);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 testMask != fHWPathStencilSettings.front().fTestMask) { 330 testMask != fHWPathStencilSettings.front().fTestMask) {
331 GL_CALL(PathStencilFunc(GrToGLStencilFunc(test), ref, testMask)); 331 GL_CALL(PathStencilFunc(GrToGLStencilFunc(test), ref, testMask));
332 } 332 }
333 fHWPathStencilSettings = stencilSettings; 333 fHWPathStencilSettings = stencilSettings;
334 } 334 }
335 } 335 }
336 336
337 inline GrGLGpu* GrGLPathRendering::gpu() { 337 inline GrGLGpu* GrGLPathRendering::gpu() {
338 return static_cast<GrGLGpu*>(fGpu); 338 return static_cast<GrGLGpu*>(fGpu);
339 } 339 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpuProgramCache.cpp ('k') | src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698