| 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 "GrRefCnt.h" | 9 #include "GrRefCnt.h" |
| 10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 SkString modulate; | 85 SkString modulate; |
| 86 GrGLSLModulatef<4>(&modulate, inputColor, "coverage"); | 86 GrGLSLModulatef<4>(&modulate, inputColor, "coverage"); |
| 87 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); | 87 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); |
| 88 } | 88 } |
| 89 | 89 |
| 90 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { | 90 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { |
| 91 return 0; | 91 return 0; |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual void setData(const GrGLUniformManager& uman, const GrDrawEffect&
) SK_OVERRIDE {} | 94 virtual void setData(const GrGLContext&, const GrDrawEffect&) SK_OVERRID
E {} |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 typedef GrGLEffect INHERITED; | 97 typedef GrGLEffect INHERITED; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 GrAlignedRectEffect() : GrEffect() { | 102 GrAlignedRectEffect() : GrEffect() { |
| 103 this->addVertexAttrib(kVec4f_GrSLType); | 103 this->addVertexAttrib(kVec4f_GrSLType); |
| 104 } | 104 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 SkString modulate; | 217 SkString modulate; |
| 218 GrGLSLModulatef<4>(&modulate, inputColor, "coverage"); | 218 GrGLSLModulatef<4>(&modulate, inputColor, "coverage"); |
| 219 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); | 219 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); |
| 220 } | 220 } |
| 221 | 221 |
| 222 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { | 222 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { |
| 223 return 0; | 223 return 0; |
| 224 } | 224 } |
| 225 | 225 |
| 226 virtual void setData(const GrGLUniformManager& uman, const GrDrawEffect&
) SK_OVERRIDE {} | 226 virtual void setData(const GrGLContext&, const GrDrawEffect&) SK_OVERRID
E {} |
| 227 | 227 |
| 228 private: | 228 private: |
| 229 typedef GrGLEffect INHERITED; | 229 typedef GrGLEffect INHERITED; |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 | 232 |
| 233 private: | 233 private: |
| 234 GrRectEffect() : GrEffect() { | 234 GrRectEffect() : GrEffect() { |
| 235 this->addVertexAttrib(kVec4f_GrSLType); | 235 this->addVertexAttrib(kVec4f_GrSLType); |
| 236 this->addVertexAttrib(kVec2f_GrSLType); | 236 this->addVertexAttrib(kVec2f_GrSLType); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 // can't call mapRect for devInside since it calls sort | 803 // can't call mapRect for devInside since it calls sort |
| 804 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; | 804 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; |
| 805 | 805 |
| 806 if (devInside.isEmpty()) { | 806 if (devInside.isEmpty()) { |
| 807 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use
VertexCoverage); | 807 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use
VertexCoverage); |
| 808 return; | 808 return; |
| 809 } | 809 } |
| 810 | 810 |
| 811 this->geometryStrokeAARect(gpu, target, devOutside, devInside, useVertexCove
rage); | 811 this->geometryStrokeAARect(gpu, target, devOutside, devInside, useVertexCove
rage); |
| 812 } | 812 } |
| OLD | NEW |