OLD | NEW |
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 private: | 99 private: |
100 GrAlignedRectEffect() | 100 GrAlignedRectEffect() |
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 GrGeometryProcessor&) const SK_OVERRIDE { retur
n 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->mulByUnknownAlpha(); | 111 inout->mulByUnknownAlpha(); |
112 } | 112 } |
113 | 113 |
114 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 114 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
115 | 115 |
116 typedef GrGeometryProcessor INHERITED; | 116 typedef GrGeometryProcessor INHERITED; |
117 }; | 117 }; |
118 | 118 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 : fInRectEdge(this->addVertexAttrib(GrShaderVar("inRectEdge", | 242 : fInRectEdge(this->addVertexAttrib(GrShaderVar("inRectEdge", |
243 kVec4f_GrSLType, | 243 kVec4f_GrSLType, |
244 GrShaderVar::kAttribute_
TypeModifier))) | 244 GrShaderVar::kAttribute_
TypeModifier))) |
245 , fInWidthHeight(this->addVertexAttrib( | 245 , fInWidthHeight(this->addVertexAttrib( |
246 GrShaderVar("inWidthHeight", | 246 GrShaderVar("inWidthHeight", |
247 kVec2f_GrSLType, | 247 kVec2f_GrSLType, |
248 GrShaderVar::kAttribute_TypeModifier))) { | 248 GrShaderVar::kAttribute_TypeModifier))) { |
249 this->setWillReadFragmentPosition(); | 249 this->setWillReadFragmentPosition(); |
250 } | 250 } |
251 | 251 |
252 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE { return true;
} | 252 virtual bool onIsEqual(const GrGeometryProcessor&) const SK_OVERRIDE { retur
n true; } |
253 | 253 |
254 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 254 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { |
255 inout->mulByUnknownAlpha(); | 255 inout->mulByUnknownAlpha(); |
256 } | 256 } |
257 | 257 |
258 const GrShaderVar& fInRectEdge; | 258 const GrShaderVar& fInRectEdge; |
259 const GrShaderVar& fInWidthHeight; | 259 const GrShaderVar& fInWidthHeight; |
260 | 260 |
261 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 261 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
262 | 262 |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 // can't call mapRect for devInside since it calls sort | 961 // can't call mapRect for devInside since it calls sort |
962 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; | 962 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; |
963 | 963 |
964 if (devInside.isEmpty()) { | 964 if (devInside.isEmpty()) { |
965 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside); | 965 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside); |
966 return; | 966 return; |
967 } | 967 } |
968 | 968 |
969 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, devIns
ide, true); | 969 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, devIns
ide, true); |
970 } | 970 } |
OLD | NEW |