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