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

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

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter Created 6 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/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrOvalRenderer.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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 : fInRect(this->addVertexAttrib(GrShaderVar("inRect", 101 : fInRect(this->addVertexAttrib(GrShaderVar("inRect",
102 kVec4f_GrSLType, 102 kVec4f_GrSLType,
103 GrShaderVar::kAttribute_Type Modifier))) { 103 GrShaderVar::kAttribute_Type Modifier))) {
104 } 104 }
105 105
106 const GrShaderVar& fInRect; 106 const GrShaderVar& fInRect;
107 107
108 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE { return true; } 108 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE { return true; }
109 109
110 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 110 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
111 inout->fValidFlags = 0; 111 inout->mulByUnknownAlpha();
112 inout->fIsSingleComponent = false;
113 } 112 }
114 113
115 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 114 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
116 115
117 typedef GrGeometryProcessor INHERITED; 116 typedef GrGeometryProcessor INHERITED;
118 }; 117 };
119 118
120 119
121 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrAlignedRectEffect); 120 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrAlignedRectEffect);
122 121
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 , fInWidthHeight(this->addVertexAttrib( 245 , fInWidthHeight(this->addVertexAttrib(
247 GrShaderVar("inWidthHeight", 246 GrShaderVar("inWidthHeight",
248 kVec2f_GrSLType, 247 kVec2f_GrSLType,
249 GrShaderVar::kAttribute_TypeModifier))) { 248 GrShaderVar::kAttribute_TypeModifier))) {
250 this->setWillReadFragmentPosition(); 249 this->setWillReadFragmentPosition();
251 } 250 }
252 251
253 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE { return true; } 252 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE { return true; }
254 253
255 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 254 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
256 inout->fValidFlags = 0; 255 inout->mulByUnknownAlpha();
257 inout->fIsSingleComponent = false;
258 } 256 }
259 257
260 const GrShaderVar& fInRectEdge; 258 const GrShaderVar& fInRectEdge;
261 const GrShaderVar& fInWidthHeight; 259 const GrShaderVar& fInWidthHeight;
262 260
263 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 261 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
264 262
265 typedef GrGeometryProcessor INHERITED; 263 typedef GrGeometryProcessor INHERITED;
266 }; 264 };
267 265
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 // can't call mapRect for devInside since it calls sort 961 // can't call mapRect for devInside since it calls sort
964 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ; 962 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ;
965 963
966 if (devInside.isEmpty()) { 964 if (devInside.isEmpty()) {
967 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside); 965 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside);
968 return; 966 return;
969 } 967 }
970 968
971 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, devIns ide, true); 969 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, devIns ide, true);
972 } 970 }
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698