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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLGpuProgramCache.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 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 "GrGLGpu.h" 8 #include "GrGLGpu.h"
9 #include "GrGLBuffer.h" 9 #include "GrGLBuffer.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 GL_CALL(Enable(GR_GL_SAMPLE_SHADING)); 2047 GL_CALL(Enable(GR_GL_SAMPLE_SHADING));
2048 GL_CALL(MinSampleShading(minSampleShading)); 2048 GL_CALL(MinSampleShading(minSampleShading));
2049 } 2049 }
2050 else { 2050 else {
2051 GL_CALL(Disable(GR_GL_SAMPLE_SHADING)); 2051 GL_CALL(Disable(GR_GL_SAMPLE_SHADING));
2052 } 2052 }
2053 fHWMinSampleShading = minSampleShading; 2053 fHWMinSampleShading = minSampleShading;
2054 } 2054 }
2055 } 2055 }
2056 2056
2057 bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcesso r& primProc) { 2057 bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcesso r& primProc,
2058 SkAutoTUnref<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc)); 2058 bool willDrawPoints) {
2059 SkAutoTUnref<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc,
2060 willDrawPoints)) ;
2059 if (!program) { 2061 if (!program) {
2060 GrCapsDebugf(this->caps(), "Failed to create program!\n"); 2062 GrCapsDebugf(this->caps(), "Failed to create program!\n");
2061 return false; 2063 return false;
2062 } 2064 }
2063 2065
2064 program->generateMipmaps(primProc, pipeline); 2066 program->generateMipmaps(primProc, pipeline);
2065 2067
2066 GrXferProcessor::BlendInfo blendInfo; 2068 GrXferProcessor::BlendInfo blendInfo;
2067 pipeline.getXferProcessor().getBlendInfo(&blendInfo); 2069 pipeline.getXferProcessor().getBlendInfo(&blendInfo);
2068 2070
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 SwapBuffers(GetDC(hwnd)); 2738 SwapBuffers(GetDC(hwnd));
2737 } 2739 }
2738 hwnd = GetNextWindow(hwnd, GW_HWNDNEXT); 2740 hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
2739 } 2741 }
2740 } 2742 }
2741 #endif 2743 #endif
2742 #endif 2744 #endif
2743 2745
2744 void GrGLGpu::draw(const GrPipeline& pipeline, 2746 void GrGLGpu::draw(const GrPipeline& pipeline,
2745 const GrPrimitiveProcessor& primProc, 2747 const GrPrimitiveProcessor& primProc,
2746 const GrMesh* meshes, 2748 const GrMesh meshes[],
2747 int meshCount) { 2749 int meshCount) {
2748 this->handleDirtyContext(); 2750 this->handleDirtyContext();
2749 2751
2750 if (!this->flushGLState(pipeline, primProc)) { 2752 bool hasPoints = false;
2753 for (int i = 0; i < meshCount; ++i) {
2754 if (meshes[i].primitiveType() == kPoints_GrPrimitiveType) {
2755 hasPoints = true;
2756 break;
2757 }
2758 }
2759 if (!this->flushGLState(pipeline, primProc, hasPoints)) {
2751 return; 2760 return;
2752 } 2761 }
2753 GrPixelLocalStorageState plsState = primProc.getPixelLocalStorageState(); 2762 GrPixelLocalStorageState plsState = primProc.getPixelLocalStorageState();
2754 if (!fHWPLSEnabled && plsState != 2763 if (!fHWPLSEnabled && plsState !=
2755 GrPixelLocalStorageState::kDisabled_GrPixelLocalStorageState) { 2764 GrPixelLocalStorageState::kDisabled_GrPixelLocalStorageState) {
2756 GL_CALL(Enable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE)); 2765 GL_CALL(Enable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE));
2757 this->setupPixelLocalStorage(pipeline, primProc); 2766 this->setupPixelLocalStorage(pipeline, primProc);
2758 fHWPLSEnabled = true; 2767 fHWPLSEnabled = true;
2759 } 2768 }
2760 if (plsState == GrPixelLocalStorageState::kFinish_GrPixelLocalStorageState) { 2769 if (plsState == GrPixelLocalStorageState::kFinish_GrPixelLocalStorageState) {
(...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after
4678 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4687 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4679 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4688 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4680 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4689 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4681 copyParams->fWidth = texture->width(); 4690 copyParams->fWidth = texture->width();
4682 copyParams->fHeight = texture->height(); 4691 copyParams->fHeight = texture->height();
4683 return true; 4692 return true;
4684 } 4693 }
4685 } 4694 }
4686 return false; 4695 return false;
4687 } 4696 }
OLDNEW
« 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