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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { | 38 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { |
39 return GrTBackendEffectFactory<GrAlignedRectEffect>::getInstance(); | 39 return GrTBackendEffectFactory<GrAlignedRectEffect>::getInstance(); |
40 } | 40 } |
41 | 41 |
42 class GLEffect : public GrGLEffect { | 42 class GLEffect : public GrGLEffect { |
43 public: | 43 public: |
44 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) | 44 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) |
45 : INHERITED (factory) {} | 45 : INHERITED (factory) {} |
46 | 46 |
| 47 virtual bool requiresVertexShader(const GrDrawEffect&) const SK_OVERRIDE
{ return true; } |
| 48 |
47 virtual void emitCode(GrGLShaderBuilder* builder, | 49 virtual void emitCode(GrGLShaderBuilder* builder, |
48 const GrDrawEffect& drawEffect, | 50 const GrDrawEffect& drawEffect, |
49 EffectKey key, | 51 EffectKey key, |
50 const char* outputColor, | 52 const char* outputColor, |
51 const char* inputColor, | 53 const char* inputColor, |
52 const TextureSamplerArray& samplers) SK_OVERRIDE { | 54 const TextureSamplerArray& samplers) SK_OVERRIDE { |
53 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertex
Builder(); | 55 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertex
Builder(); |
54 SkASSERT(NULL != vertexBuilder); | 56 SkASSERT(NULL != vertexBuilder); |
55 | 57 |
56 // setup the varying for the Axis aligned rect effect | 58 // setup the varying for the Axis aligned rect effect |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 159 |
158 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { | 160 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { |
159 return GrTBackendEffectFactory<GrRectEffect>::getInstance(); | 161 return GrTBackendEffectFactory<GrRectEffect>::getInstance(); |
160 } | 162 } |
161 | 163 |
162 class GLEffect : public GrGLEffect { | 164 class GLEffect : public GrGLEffect { |
163 public: | 165 public: |
164 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) | 166 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) |
165 : INHERITED (factory) {} | 167 : INHERITED (factory) {} |
166 | 168 |
| 169 virtual bool requiresVertexShader(const GrDrawEffect&) const SK_OVERRIDE
{ return true; } |
| 170 |
167 virtual void emitCode(GrGLShaderBuilder* builder, | 171 virtual void emitCode(GrGLShaderBuilder* builder, |
168 const GrDrawEffect& drawEffect, | 172 const GrDrawEffect& drawEffect, |
169 EffectKey key, | 173 EffectKey key, |
170 const char* outputColor, | 174 const char* outputColor, |
171 const char* inputColor, | 175 const char* inputColor, |
172 const TextureSamplerArray& samplers) SK_OVERRIDE { | 176 const TextureSamplerArray& samplers) SK_OVERRIDE { |
173 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertex
Builder(); | 177 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertex
Builder(); |
174 SkASSERT(NULL != vertexBuilder); | 178 SkASSERT(NULL != vertexBuilder); |
175 | 179 |
176 // setup the varying for the center point and the unit vector | 180 // setup the varying for the center point and the unit vector |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 // can't call mapRect for devInside since it calls sort | 813 // can't call mapRect for devInside since it calls sort |
810 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; | 814 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; |
811 | 815 |
812 if (devInside.isEmpty()) { | 816 if (devInside.isEmpty()) { |
813 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use
VertexCoverage); | 817 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use
VertexCoverage); |
814 return; | 818 return; |
815 } | 819 } |
816 | 820 |
817 this->geometryStrokeAARect(gpu, target, devOutside, devInside, useVertexCove
rage); | 821 this->geometryStrokeAARect(gpu, target, devOutside, devInside, useVertexCove
rage); |
818 } | 822 } |
OLD | NEW |