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

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

Issue 1438003003: Move all ShaderBuilder files to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@glslProgBuild
Patch Set: nits Created 5 years, 1 month 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/GrGLPrimitiveProcessor.cpp ('k') | src/gpu/gl/GrGLSLBlend.h » ('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 2013 Google Inc. 2 * Copyright 2013 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 #include "GrGLProgramDesc.h" 7 #include "GrGLProgramDesc.h"
8 8
9 #include "GrGLFragmentProcessor.h" 9 #include "GrGLFragmentProcessor.h"
10 #include "GrProcessor.h" 10 #include "GrProcessor.h"
11 #include "GrGLGpu.h" 11 #include "GrGLGpu.h"
12 #include "GrPipeline.h" 12 #include "GrPipeline.h"
13 #include "SkChecksum.h" 13 #include "SkChecksum.h"
14 #include "gl/builders/GrGLFragmentShaderBuilder.h" 14 #include "glsl/GrGLSLFragmentShaderBuilder.h"
15 15
16 /** 16 /**
17 * Do we need to either map r,g,b->a or a->r. configComponentMask indicates whic h channels are 17 * Do we need to either map r,g,b->a or a->r. configComponentMask indicates whic h channels are
18 * present in the texture's config. swizzleComponentMask indicates the channels present in the 18 * present in the texture's config. swizzleComponentMask indicates the channels present in the
19 * shader swizzle. 19 * shader swizzle.
20 */ 20 */
21 static bool swizzle_requires_alpha_remapping(const GrGLSLCaps& caps, GrPixelConf ig config) { 21 static bool swizzle_requires_alpha_remapping(const GrGLSLCaps& caps, GrPixelConf ig config) {
22 if (!caps.mustSwizzleInShader()) { 22 if (!caps.mustSwizzleInShader()) {
23 // Any remapping is handled using texture swizzling not shader modificat ions. 23 // Any remapping is handled using texture swizzling not shader modificat ions.
24 return false; 24 return false;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- ------------------- 139 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- -------------------
140 // Because header is a pointer into the dynamic array, we can't push any new data into the key 140 // Because header is a pointer into the dynamic array, we can't push any new data into the key
141 // below here. 141 // below here.
142 KeyHeader* header = glDesc->atOffset<KeyHeader, kHeaderOffset>(); 142 KeyHeader* header = glDesc->atOffset<KeyHeader, kHeaderOffset>();
143 143
144 // make sure any padding in the header is zeroed. 144 // make sure any padding in the header is zeroed.
145 memset(header, 0, kHeaderSize); 145 memset(header, 0, kHeaderSize);
146 146
147 if (pipeline.readsFragPosition()) { 147 if (pipeline.readsFragPosition()) {
148 header->fFragPosKey = 148 header->fFragPosKey =
149 GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRe nderTarget()); 149 GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.get RenderTarget());
150 } else { 150 } else {
151 header->fFragPosKey = 0; 151 header->fFragPosKey = 0;
152 } 152 }
153 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); 153 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();
154 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); 154 header->fColorEffectCnt = pipeline.numColorFragmentProcessors();
155 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); 155 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors();
156 glDesc->finalize(); 156 glDesc->finalize();
157 return true; 157 return true;
158 } 158 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPrimitiveProcessor.cpp ('k') | src/gpu/gl/GrGLSLBlend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698