OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrProcessor.h" | 10 #include "GrProcessor.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 class CircleEdgeEffect : public GrGeometryProcessor { | 66 class CircleEdgeEffect : public GrGeometryProcessor { |
67 public: | 67 public: |
68 static GrGeometryProcessor* Create(GrColor color, bool stroke, const SkMatri
x& localMatrix) { | 68 static GrGeometryProcessor* Create(GrColor color, bool stroke, const SkMatri
x& localMatrix) { |
69 return SkNEW_ARGS(CircleEdgeEffect, (color, stroke, localMatrix)); | 69 return SkNEW_ARGS(CircleEdgeEffect, (color, stroke, localMatrix)); |
70 } | 70 } |
71 | 71 |
72 const GrAttribute* inPosition() const { return fInPosition; } | 72 const GrAttribute* inPosition() const { return fInPosition; } |
73 const GrAttribute* inCircleEdge() const { return fInCircleEdge; } | 73 const GrAttribute* inCircleEdge() const { return fInCircleEdge; } |
74 virtual ~CircleEdgeEffect() {} | 74 virtual ~CircleEdgeEffect() {} |
75 | 75 |
76 virtual const char* name() const SK_OVERRIDE { return "CircleEdge"; } | 76 const char* name() const SK_OVERRIDE { return "CircleEdge"; } |
77 | 77 |
78 inline bool isStroked() const { return fStroke; } | 78 inline bool isStroked() const { return fStroke; } |
79 | 79 |
80 class GLProcessor : public GrGLGeometryProcessor { | 80 class GLProcessor : public GrGLGeometryProcessor { |
81 public: | 81 public: |
82 GLProcessor(const GrGeometryProcessor&, | 82 GLProcessor(const GrGeometryProcessor&, |
83 const GrBatchTracker&) | 83 const GrBatchTracker&) |
84 : fColor(GrColor_ILLEGAL) {} | 84 : fColor(GrColor_ILLEGAL) {} |
85 | 85 |
86 virtual void emitCode(const EmitArgs& args) SK_OVERRIDE { | 86 void emitCode(const EmitArgs& args) SK_OVERRIDE { |
87 const CircleEdgeEffect& ce = args.fGP.cast<CircleEdgeEffect>(); | 87 const CircleEdgeEffect& ce = args.fGP.cast<CircleEdgeEffect>(); |
88 GrGLGPBuilder* pb = args.fPB; | 88 GrGLGPBuilder* pb = args.fPB; |
89 const BatchTracker& local = args.fBT.cast<BatchTracker>(); | 89 const BatchTracker& local = args.fBT.cast<BatchTracker>(); |
90 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); | 90 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
91 | 91 |
92 GrGLVertToFrag v(kVec4f_GrSLType); | 92 GrGLVertToFrag v(kVec4f_GrSLType); |
93 args.fPB->addVarying("CircleEdge", &v); | 93 args.fPB->addVarying("CircleEdge", &v); |
94 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), ce.inCircleEdge()->fNa
me); | 94 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), ce.inCircleEdge()->fNa
me); |
95 | 95 |
96 // Setup pass through color | 96 // Setup pass through color |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 UniformHandle fColorUniform; | 150 UniformHandle fColorUniform; |
151 typedef GrGLGeometryProcessor INHERITED; | 151 typedef GrGLGeometryProcessor INHERITED; |
152 }; | 152 }; |
153 | 153 |
154 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 154 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
155 const GrGLCaps& caps, | 155 const GrGLCaps& caps, |
156 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 156 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
157 GLProcessor::GenKey(*this, bt, caps, b); | 157 GLProcessor::GenKey(*this, bt, caps, b); |
158 } | 158 } |
159 | 159 |
160 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co
nst SK_OVERRIDE { | 160 GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_O
VERRIDE { |
161 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 161 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
162 } | 162 } |
163 | 163 |
164 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 164 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { |
165 BatchTracker* local = bt->cast<BatchTracker>(); | 165 BatchTracker* local = bt->cast<BatchTracker>(); |
166 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 166 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
167 local->fUsesLocalCoords = init.fUsesLocalCoords; | 167 local->fUsesLocalCoords = init.fUsesLocalCoords; |
168 } | 168 } |
169 | 169 |
170 bool onCanMakeEqual(const GrBatchTracker& m, | 170 bool onCanMakeEqual(const GrBatchTracker& m, |
(...skipping 10 matching lines...) Expand all Loading... |
181 private: | 181 private: |
182 CircleEdgeEffect(GrColor color, bool stroke, const SkMatrix& localMatrix) | 182 CircleEdgeEffect(GrColor color, bool stroke, const SkMatrix& localMatrix) |
183 : INHERITED(color, SkMatrix::I(), localMatrix) { | 183 : INHERITED(color, SkMatrix::I(), localMatrix) { |
184 this->initClassID<CircleEdgeEffect>(); | 184 this->initClassID<CircleEdgeEffect>(); |
185 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr
VertexAttribType)); | 185 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr
VertexAttribType)); |
186 fInCircleEdge = &this->addVertexAttrib(GrAttribute("inCircleEdge", | 186 fInCircleEdge = &this->addVertexAttrib(GrAttribute("inCircleEdge", |
187 kVec4f_GrVertexAttrib
Type)); | 187 kVec4f_GrVertexAttrib
Type)); |
188 fStroke = stroke; | 188 fStroke = stroke; |
189 } | 189 } |
190 | 190 |
191 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { | 191 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { |
192 const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>(); | 192 const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>(); |
193 return cee.fStroke == fStroke; | 193 return cee.fStroke == fStroke; |
194 } | 194 } |
195 | 195 |
196 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 196 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERR
IDE { |
197 out->setUnknownSingleComponent(); | 197 out->setUnknownSingleComponent(); |
198 } | 198 } |
199 | 199 |
200 struct BatchTracker { | 200 struct BatchTracker { |
201 GrGPInput fInputColorType; | 201 GrGPInput fInputColorType; |
202 GrColor fColor; | 202 GrColor fColor; |
203 bool fUsesLocalCoords; | 203 bool fUsesLocalCoords; |
204 }; | 204 }; |
205 | 205 |
206 const GrAttribute* fInPosition; | 206 const GrAttribute* fInPosition; |
(...skipping 27 matching lines...) Expand all Loading... |
234 */ | 234 */ |
235 | 235 |
236 class EllipseEdgeEffect : public GrGeometryProcessor { | 236 class EllipseEdgeEffect : public GrGeometryProcessor { |
237 public: | 237 public: |
238 static GrGeometryProcessor* Create(GrColor color, bool stroke, const SkMatri
x& localMatrix) { | 238 static GrGeometryProcessor* Create(GrColor color, bool stroke, const SkMatri
x& localMatrix) { |
239 return SkNEW_ARGS(EllipseEdgeEffect, (color, stroke, localMatrix)); | 239 return SkNEW_ARGS(EllipseEdgeEffect, (color, stroke, localMatrix)); |
240 } | 240 } |
241 | 241 |
242 virtual ~EllipseEdgeEffect() {} | 242 virtual ~EllipseEdgeEffect() {} |
243 | 243 |
244 virtual const char* name() const SK_OVERRIDE { return "EllipseEdge"; } | 244 const char* name() const SK_OVERRIDE { return "EllipseEdge"; } |
245 | 245 |
246 const GrAttribute* inPosition() const { return fInPosition; } | 246 const GrAttribute* inPosition() const { return fInPosition; } |
247 const GrAttribute* inEllipseOffset() const { return fInEllipseOffset; } | 247 const GrAttribute* inEllipseOffset() const { return fInEllipseOffset; } |
248 const GrAttribute* inEllipseRadii() const { return fInEllipseRadii; } | 248 const GrAttribute* inEllipseRadii() const { return fInEllipseRadii; } |
249 | 249 |
250 inline bool isStroked() const { return fStroke; } | 250 inline bool isStroked() const { return fStroke; } |
251 | 251 |
252 class GLProcessor : public GrGLGeometryProcessor { | 252 class GLProcessor : public GrGLGeometryProcessor { |
253 public: | 253 public: |
254 GLProcessor(const GrGeometryProcessor&, | 254 GLProcessor(const GrGeometryProcessor&, |
255 const GrBatchTracker&) | 255 const GrBatchTracker&) |
256 : fColor(GrColor_ILLEGAL) {} | 256 : fColor(GrColor_ILLEGAL) {} |
257 | 257 |
258 virtual void emitCode(const EmitArgs& args) SK_OVERRIDE { | 258 void emitCode(const EmitArgs& args) SK_OVERRIDE { |
259 const EllipseEdgeEffect& ee = args.fGP.cast<EllipseEdgeEffect>(); | 259 const EllipseEdgeEffect& ee = args.fGP.cast<EllipseEdgeEffect>(); |
260 GrGLGPBuilder* pb = args.fPB; | 260 GrGLGPBuilder* pb = args.fPB; |
261 const BatchTracker& local = args.fBT.cast<BatchTracker>(); | 261 const BatchTracker& local = args.fBT.cast<BatchTracker>(); |
262 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); | 262 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
263 | 263 |
264 GrGLVertToFrag ellipseOffsets(kVec2f_GrSLType); | 264 GrGLVertToFrag ellipseOffsets(kVec2f_GrSLType); |
265 args.fPB->addVarying("EllipseOffsets", &ellipseOffsets); | 265 args.fPB->addVarying("EllipseOffsets", &ellipseOffsets); |
266 vsBuilder->codeAppendf("%s = %s;", ellipseOffsets.vsOut(), | 266 vsBuilder->codeAppendf("%s = %s;", ellipseOffsets.vsOut(), |
267 ee.inEllipseOffset()->fName); | 267 ee.inEllipseOffset()->fName); |
268 | 268 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 typedef GrGLGeometryProcessor INHERITED; | 345 typedef GrGLGeometryProcessor INHERITED; |
346 }; | 346 }; |
347 | 347 |
348 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 348 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
349 const GrGLCaps& caps, | 349 const GrGLCaps& caps, |
350 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 350 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
351 GLProcessor::GenKey(*this, bt, caps, b); | 351 GLProcessor::GenKey(*this, bt, caps, b); |
352 } | 352 } |
353 | 353 |
354 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co
nst SK_OVERRIDE { | 354 GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_O
VERRIDE { |
355 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 355 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
356 } | 356 } |
357 | 357 |
358 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 358 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { |
359 BatchTracker* local = bt->cast<BatchTracker>(); | 359 BatchTracker* local = bt->cast<BatchTracker>(); |
360 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 360 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
361 local->fUsesLocalCoords = init.fUsesLocalCoords; | 361 local->fUsesLocalCoords = init.fUsesLocalCoords; |
362 } | 362 } |
363 | 363 |
364 bool onCanMakeEqual(const GrBatchTracker& m, | 364 bool onCanMakeEqual(const GrBatchTracker& m, |
(...skipping 12 matching lines...) Expand all Loading... |
377 : INHERITED(color, SkMatrix::I(), localMatrix) { | 377 : INHERITED(color, SkMatrix::I(), localMatrix) { |
378 this->initClassID<EllipseEdgeEffect>(); | 378 this->initClassID<EllipseEdgeEffect>(); |
379 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr
VertexAttribType)); | 379 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr
VertexAttribType)); |
380 fInEllipseOffset = &this->addVertexAttrib(GrAttribute("inEllipseOffset", | 380 fInEllipseOffset = &this->addVertexAttrib(GrAttribute("inEllipseOffset", |
381 kVec2f_GrVertexAtt
ribType)); | 381 kVec2f_GrVertexAtt
ribType)); |
382 fInEllipseRadii = &this->addVertexAttrib(GrAttribute("inEllipseRadii", | 382 fInEllipseRadii = &this->addVertexAttrib(GrAttribute("inEllipseRadii", |
383 kVec4f_GrVertexAttr
ibType)); | 383 kVec4f_GrVertexAttr
ibType)); |
384 fStroke = stroke; | 384 fStroke = stroke; |
385 } | 385 } |
386 | 386 |
387 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { | 387 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { |
388 const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>(); | 388 const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>(); |
389 return eee.fStroke == fStroke; | 389 return eee.fStroke == fStroke; |
390 } | 390 } |
391 | 391 |
392 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 392 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERR
IDE { |
393 out->setUnknownSingleComponent(); | 393 out->setUnknownSingleComponent(); |
394 } | 394 } |
395 | 395 |
396 struct BatchTracker { | 396 struct BatchTracker { |
397 GrGPInput fInputColorType; | 397 GrGPInput fInputColorType; |
398 GrColor fColor; | 398 GrColor fColor; |
399 bool fUsesLocalCoords; | 399 bool fUsesLocalCoords; |
400 }; | 400 }; |
401 | 401 |
402 const GrAttribute* fInPosition; | 402 const GrAttribute* fInPosition; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 class DIEllipseEdgeEffect : public GrGeometryProcessor { | 434 class DIEllipseEdgeEffect : public GrGeometryProcessor { |
435 public: | 435 public: |
436 enum Mode { kStroke = 0, kHairline, kFill }; | 436 enum Mode { kStroke = 0, kHairline, kFill }; |
437 | 437 |
438 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, Mode mode) { | 438 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, Mode mode) { |
439 return SkNEW_ARGS(DIEllipseEdgeEffect, (color, viewMatrix, mode)); | 439 return SkNEW_ARGS(DIEllipseEdgeEffect, (color, viewMatrix, mode)); |
440 } | 440 } |
441 | 441 |
442 virtual ~DIEllipseEdgeEffect() {} | 442 virtual ~DIEllipseEdgeEffect() {} |
443 | 443 |
444 virtual const char* name() const SK_OVERRIDE { return "DIEllipseEdge"; } | 444 const char* name() const SK_OVERRIDE { return "DIEllipseEdge"; } |
445 | 445 |
446 const GrAttribute* inPosition() const { return fInPosition; } | 446 const GrAttribute* inPosition() const { return fInPosition; } |
447 const GrAttribute* inEllipseOffsets0() const { return fInEllipseOffsets0; } | 447 const GrAttribute* inEllipseOffsets0() const { return fInEllipseOffsets0; } |
448 const GrAttribute* inEllipseOffsets1() const { return fInEllipseOffsets1; } | 448 const GrAttribute* inEllipseOffsets1() const { return fInEllipseOffsets1; } |
449 | 449 |
450 inline Mode getMode() const { return fMode; } | 450 inline Mode getMode() const { return fMode; } |
451 | 451 |
452 class GLProcessor : public GrGLGeometryProcessor { | 452 class GLProcessor : public GrGLGeometryProcessor { |
453 public: | 453 public: |
454 GLProcessor(const GrGeometryProcessor&, | 454 GLProcessor(const GrGeometryProcessor&, |
455 const GrBatchTracker&) | 455 const GrBatchTracker&) |
456 : fColor(GrColor_ILLEGAL) {} | 456 : fColor(GrColor_ILLEGAL) {} |
457 | 457 |
458 virtual void emitCode(const EmitArgs& args) SK_OVERRIDE { | 458 void emitCode(const EmitArgs& args) SK_OVERRIDE { |
459 const DIEllipseEdgeEffect& ee = args.fGP.cast<DIEllipseEdgeEffect>()
; | 459 const DIEllipseEdgeEffect& ee = args.fGP.cast<DIEllipseEdgeEffect>()
; |
460 GrGLGPBuilder* pb = args.fPB; | 460 GrGLGPBuilder* pb = args.fPB; |
461 const BatchTracker& local = args.fBT.cast<BatchTracker>(); | 461 const BatchTracker& local = args.fBT.cast<BatchTracker>(); |
462 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); | 462 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
463 | 463 |
464 GrGLVertToFrag offsets0(kVec2f_GrSLType); | 464 GrGLVertToFrag offsets0(kVec2f_GrSLType); |
465 args.fPB->addVarying("EllipseOffsets0", &offsets0); | 465 args.fPB->addVarying("EllipseOffsets0", &offsets0); |
466 vsBuilder->codeAppendf("%s = %s;", offsets0.vsOut(), | 466 vsBuilder->codeAppendf("%s = %s;", offsets0.vsOut(), |
467 ee.inEllipseOffsets0()->fName); | 467 ee.inEllipseOffsets0()->fName); |
468 | 468 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 | 559 |
560 typedef GrGLGeometryProcessor INHERITED; | 560 typedef GrGLGeometryProcessor INHERITED; |
561 }; | 561 }; |
562 | 562 |
563 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 563 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
564 const GrGLCaps& caps, | 564 const GrGLCaps& caps, |
565 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 565 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
566 GLProcessor::GenKey(*this, bt, caps, b); | 566 GLProcessor::GenKey(*this, bt, caps, b); |
567 } | 567 } |
568 | 568 |
569 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co
nst SK_OVERRIDE { | 569 GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_O
VERRIDE { |
570 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 570 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
571 } | 571 } |
572 | 572 |
573 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 573 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { |
574 BatchTracker* local = bt->cast<BatchTracker>(); | 574 BatchTracker* local = bt->cast<BatchTracker>(); |
575 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 575 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
576 local->fUsesLocalCoords = init.fUsesLocalCoords; | 576 local->fUsesLocalCoords = init.fUsesLocalCoords; |
577 } | 577 } |
578 | 578 |
579 bool onCanMakeEqual(const GrBatchTracker& m, | 579 bool onCanMakeEqual(const GrBatchTracker& m, |
(...skipping 12 matching lines...) Expand all Loading... |
592 : INHERITED(color, viewMatrix) { | 592 : INHERITED(color, viewMatrix) { |
593 this->initClassID<DIEllipseEdgeEffect>(); | 593 this->initClassID<DIEllipseEdgeEffect>(); |
594 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr
VertexAttribType)); | 594 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr
VertexAttribType)); |
595 fInEllipseOffsets0 = &this->addVertexAttrib(GrAttribute("inEllipseOffset
s0", | 595 fInEllipseOffsets0 = &this->addVertexAttrib(GrAttribute("inEllipseOffset
s0", |
596 kVec2f_GrVertexA
ttribType)); | 596 kVec2f_GrVertexA
ttribType)); |
597 fInEllipseOffsets1 = &this->addVertexAttrib(GrAttribute("inEllipseOffset
s1", | 597 fInEllipseOffsets1 = &this->addVertexAttrib(GrAttribute("inEllipseOffset
s1", |
598 kVec2f_GrVertexA
ttribType)); | 598 kVec2f_GrVertexA
ttribType)); |
599 fMode = mode; | 599 fMode = mode; |
600 } | 600 } |
601 | 601 |
602 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { | 602 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { |
603 const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>(); | 603 const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>(); |
604 return eee.fMode == fMode; | 604 return eee.fMode == fMode; |
605 } | 605 } |
606 | 606 |
607 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 607 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERR
IDE { |
608 out->setUnknownSingleComponent(); | 608 out->setUnknownSingleComponent(); |
609 } | 609 } |
610 | 610 |
611 struct BatchTracker { | 611 struct BatchTracker { |
612 GrGPInput fInputColorType; | 612 GrGPInput fInputColorType; |
613 GrColor fColor; | 613 GrColor fColor; |
614 bool fUsesLocalCoords; | 614 bool fUsesLocalCoords; |
615 }; | 615 }; |
616 | 616 |
617 const GrAttribute* fInPosition; | 617 const GrAttribute* fInPosition; |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : | 1398 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : |
1399 SK_ARRAY_COUNT(gRRectIndices); | 1399 SK_ARRAY_COUNT(gRRectIndices); |
1400 target->setIndexSourceToBuffer(indexBuffer); | 1400 target->setIndexSourceToBuffer(indexBuffer); |
1401 target->drawIndexedInstances(drawState, effect, kTriangles_GrPrimitiveTy
pe, 1, 16, indexCnt, | 1401 target->drawIndexedInstances(drawState, effect, kTriangles_GrPrimitiveTy
pe, 1, 16, indexCnt, |
1402 &bounds); | 1402 &bounds); |
1403 } | 1403 } |
1404 | 1404 |
1405 target->resetIndexSource(); | 1405 target->resetIndexSource(); |
1406 return true; | 1406 return true; |
1407 } | 1407 } |
OLD | NEW |