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

Side by Side Diff: src/gpu/GrAARectRenderer.cpp

Issue 649783003: Force input coverage to be only a byte in gpu shaders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrDrawState.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 2012 Google Inc. 2 * Copyright 2012 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 "GrAARectRenderer.h" 8 #include "GrAARectRenderer.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 GrTexture* textures[]) { 258 GrTexture* textures[]) {
259 return GrRectEffect::Create(); 259 return GrRectEffect::Create();
260 } 260 }
261 261
262 /////////////////////////////////////////////////////////////////////////////// 262 ///////////////////////////////////////////////////////////////////////////////
263 263
264 namespace { 264 namespace {
265 extern const GrVertexAttrib gAARectAttribs[] = { 265 extern const GrVertexAttrib gAARectAttribs[] = {
266 {kVec2f_GrVertexAttribType, 0, kPosition_Gr VertexAttribBinding}, 266 {kVec2f_GrVertexAttribType, 0, kPosition_Gr VertexAttribBinding},
267 {kVec4ub_GrVertexAttribType, sizeof(SkPoint), kColor_GrVer texAttribBinding}, 267 {kVec4ub_GrVertexAttribType, sizeof(SkPoint), kColor_GrVer texAttribBinding},
268 {kVec4ub_GrVertexAttribType, sizeof(SkPoint) + sizeof(SkColor), kCoverage_Gr VertexAttribBinding}, 268 {kUByte_GrVertexAttribType, sizeof(SkPoint) + sizeof(SkColor), kCoverage_GrV ertexAttribBinding},
269 }; 269 };
270 270
271 // Should the coverage be multiplied into the color attrib or use a separate att rib. 271 // Should the coverage be multiplied into the color attrib or use a separate att rib.
272 enum CoverageAttribType { 272 enum CoverageAttribType {
273 kUseColor_CoverageAttribType, 273 kUseColor_CoverageAttribType,
274 kUseCoverage_CoverageAttribType, 274 kUseCoverage_CoverageAttribType,
275 }; 275 };
276 } 276 }
277 277
278 static CoverageAttribType set_rect_attribs(GrDrawState* drawState) { 278 static CoverageAttribType set_rect_attribs(GrDrawState* drawState) {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 // can't call mapRect for devInside since it calls sort 910 // can't call mapRect for devInside since it calls sort
911 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ; 911 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ;
912 912
913 if (devInside.isEmpty()) { 913 if (devInside.isEmpty()) {
914 this->fillAARect(target, devOutside, SkMatrix::I(), devOutside); 914 this->fillAARect(target, devOutside, SkMatrix::I(), devOutside);
915 return; 915 return;
916 } 916 }
917 917
918 this->geometryStrokeAARect(target, devOutside, devOutsideAssist, devInside, true); 918 this->geometryStrokeAARect(target, devOutside, devOutsideAssist, devInside, true);
919 } 919 }
OLDNEW
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698