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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2358843002: Conditionally insert gl_PointSize into shaders. (Closed)
Patch Set: minor Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLGpuProgramCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 52c7d944242fef3322f91bc1396e4c755b8188a9..fcd3270ba245c0229a1415b5df7da90c283f5df2 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2054,8 +2054,10 @@ void GrGLGpu::flushMinSampleShading(float minSampleShading) {
}
}
-bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc) {
- SkAutoTUnref<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc));
+bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc,
+ bool willDrawPoints) {
+ SkAutoTUnref<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc,
+ willDrawPoints));
if (!program) {
GrCapsDebugf(this->caps(), "Failed to create program!\n");
return false;
@@ -2743,11 +2745,18 @@ GrGLenum gPrimitiveType2GLMode[] = {
void GrGLGpu::draw(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
- const GrMesh* meshes,
+ const GrMesh meshes[],
int meshCount) {
this->handleDirtyContext();
- if (!this->flushGLState(pipeline, primProc)) {
+ bool hasPoints = false;
+ for (int i = 0; i < meshCount; ++i) {
+ if (meshes[i].primitiveType() == kPoints_GrPrimitiveType) {
+ hasPoints = true;
+ break;
+ }
+ }
+ if (!this->flushGLState(pipeline, primProc, hasPoints)) {
return;
}
GrPixelLocalStorageState plsState = primProc.getPixelLocalStorageState();
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLGpuProgramCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698