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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |