Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 772513002: create and thread batch tracker object (Closed) Base URL: https://skia.googlesource.com/skia.git@2_vertex_attr
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrTBackendProcessorFactory.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 const GrAttribute* inPosition() const { return fInPosition; } 521 const GrAttribute* inPosition() const { return fInPosition; }
522 const GrAttribute* inQuadEdge() const { return fInQuadEdge; } 522 const GrAttribute* inQuadEdge() const { return fInQuadEdge; }
523 523
524 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE { 524 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE {
525 return GrTBackendGeometryProcessorFactory<QuadEdgeEffect>::getInstance() ; 525 return GrTBackendGeometryProcessorFactory<QuadEdgeEffect>::getInstance() ;
526 } 526 }
527 527
528 class GLProcessor : public GrGLGeometryProcessor { 528 class GLProcessor : public GrGLGeometryProcessor {
529 public: 529 public:
530 GLProcessor(const GrBackendProcessorFactory& factory, const GrProcessor& ) 530 GLProcessor(const GrBackendProcessorFactory& factory,
531 const GrGeometryProcessor&,
532 const GrBatchTracker&)
531 : INHERITED (factory) {} 533 : INHERITED (factory) {}
532 534
533 virtual void emitCode(const EmitArgs& args) SK_OVERRIDE { 535 virtual void emitCode(const EmitArgs& args) SK_OVERRIDE {
534 const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>(); 536 const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>();
535 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); 537 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
536 538
537 GrGLVertToFrag v(kVec4f_GrSLType); 539 GrGLVertToFrag v(kVec4f_GrSLType);
538 args.fPB->addVarying("QuadEdge", &v); 540 args.fPB->addVarying("QuadEdge", &v);
539 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName ); 541 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName );
540 542
(...skipping 23 matching lines...) Expand all
564 " 2.0*%s.x*duvdy.x - duvdy.y);" , 566 " 2.0*%s.x*duvdy.x - duvdy.y);" ,
565 v.fsIn(), v.fsIn()); 567 v.fsIn(), v.fsIn());
566 fsBuilder->codeAppendf("edgeAlpha = (%s.x*%s.x - %s.y);", v.fsIn(), v.fsIn(), 568 fsBuilder->codeAppendf("edgeAlpha = (%s.x*%s.x - %s.y);", v.fsIn(), v.fsIn(),
567 v.fsIn()); 569 v.fsIn());
568 fsBuilder->codeAppendf("edgeAlpha = " 570 fsBuilder->codeAppendf("edgeAlpha = "
569 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0 );}"); 571 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0 );}");
570 572
571 fsBuilder->codeAppendf("%s = vec4(edgeAlpha);", args.fOutputCoverage ); 573 fsBuilder->codeAppendf("%s = vec4(edgeAlpha);", args.fOutputCoverage );
572 } 574 }
573 575
574 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcess orKeyBuilder*) {} 576 static inline void GenKey(const GrGeometryProcessor&,
577 const GrBatchTracker&,
578 const GrGLCaps&,
579 GrProcessorKeyBuilder*) {}
575 580
576 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE {} 581 virtual void setData(const GrGLProgramDataManager&,
582 const GrGeometryProcessor&,
583 const GrBatchTracker&) SK_OVERRIDE {}
577 584
578 private: 585 private:
579 typedef GrGLGeometryProcessor INHERITED; 586 typedef GrGLGeometryProcessor INHERITED;
580 }; 587 };
581 588
582 private: 589 private:
583 QuadEdgeEffect() { 590 QuadEdgeEffect() {
584 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr VertexAttribType)); 591 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr VertexAttribType));
585 fInQuadEdge = &this->addVertexAttrib(GrAttribute("inQuadEdge", kVec4f_Gr VertexAttribType)); 592 fInQuadEdge = &this->addVertexAttrib(GrAttribute("inQuadEdge", kVec4f_Gr VertexAttribType));
586 } 593 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 vOffset, // start vertex 712 vOffset, // start vertex
706 0, // start index 713 0, // start index
707 draw.fVertexCnt, 714 draw.fVertexCnt,
708 draw.fIndexCnt, 715 draw.fIndexCnt,
709 &devBounds); 716 &devBounds);
710 vOffset += draw.fVertexCnt; 717 vOffset += draw.fVertexCnt;
711 } 718 }
712 719
713 return true; 720 return true;
714 } 721 }
OLDNEW
« no previous file with comments | « include/gpu/GrTBackendProcessorFactory.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698