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

Side by Side Diff: src/gpu/effects/GrRRectEffect.cpp

Issue 1443743002: Rename some processor functions from GL to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@primProcs
Patch Set: nits Created 5 years, 1 month 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 | « src/gpu/effects/GrPorterDuffXferProcessor.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.h » ('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 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "GrRRectEffect.h" 8 #include "GrRRectEffect.h"
9 9
10 #include "GrConvexPolyEffect.h" 10 #include "GrConvexPolyEffect.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 const SkRRect& getRRect() const { return fRRect; } 54 const SkRRect& getRRect() const { return fRRect; }
55 55
56 uint32_t getCircularCornerFlags() const { return fCircularCornerFlags; } 56 uint32_t getCircularCornerFlags() const { return fCircularCornerFlags; }
57 57
58 GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } 58 GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
59 59
60 private: 60 private:
61 CircularRRectEffect(GrPrimitiveEdgeType, uint32_t circularCornerFlags, const SkRRect&); 61 CircularRRectEffect(GrPrimitiveEdgeType, uint32_t circularCornerFlags, const SkRRect&);
62 62
63 GrGLSLFragmentProcessor* onCreateGLInstance() const override; 63 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
64 64
65 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov erride; 65 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
66 66
67 bool onIsEqual(const GrFragmentProcessor& other) const override; 67 bool onIsEqual(const GrFragmentProcessor& other) const override;
68 68
69 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; 69 void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
70 70
71 SkRRect fRRect; 71 SkRRect fRRect;
72 GrPrimitiveEdgeType fEdgeType; 72 GrPrimitiveEdgeType fEdgeType;
73 uint32_t fCircularCornerFlags; 73 uint32_t fCircularCornerFlags;
74 74
75 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 75 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 SkFAIL("Should have been one of the above cases."); 357 SkFAIL("Should have been one of the above cases.");
358 } 358 }
359 pdman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect. fBottom); 359 pdman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect. fBottom);
360 pdman.set1f(fRadiusPlusHalfUniform, radius + 0.5f); 360 pdman.set1f(fRadiusPlusHalfUniform, radius + 0.5f);
361 fPrevRRect = rrect; 361 fPrevRRect = rrect;
362 } 362 }
363 } 363 }
364 364
365 //////////////////////////////////////////////////////////////////////////////// //////////////////// 365 //////////////////////////////////////////////////////////////////////////////// ////////////////////
366 366
367 void CircularRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, 367 void CircularRRectEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
368 GrProcessorKeyBuilder* b) const { 368 GrProcessorKeyBuilder* b) const {
369 GLCircularRRectEffect::GenKey(*this, caps, b); 369 GLCircularRRectEffect::GenKey(*this, caps, b);
370 } 370 }
371 371
372 GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const { 372 GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLSLInstance() const {
373 return new GLCircularRRectEffect(*this); 373 return new GLCircularRRectEffect(*this);
374 } 374 }
375 375
376 ////////////////////////////////////////////////////////////////////////////// 376 //////////////////////////////////////////////////////////////////////////////
377 377
378 class EllipticalRRectEffect : public GrFragmentProcessor { 378 class EllipticalRRectEffect : public GrFragmentProcessor {
379 public: 379 public:
380 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkRRect&); 380 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkRRect&);
381 381
382 virtual ~EllipticalRRectEffect() {}; 382 virtual ~EllipticalRRectEffect() {};
383 383
384 const char* name() const override { return "EllipticalRRect"; } 384 const char* name() const override { return "EllipticalRRect"; }
385 385
386 const SkRRect& getRRect() const { return fRRect; } 386 const SkRRect& getRRect() const { return fRRect; }
387 387
388 GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } 388 GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
389 389
390 private: 390 private:
391 EllipticalRRectEffect(GrPrimitiveEdgeType, const SkRRect&); 391 EllipticalRRectEffect(GrPrimitiveEdgeType, const SkRRect&);
392 392
393 GrGLSLFragmentProcessor* onCreateGLInstance() const override; 393 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
394 394
395 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov erride; 395 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
396 396
397 bool onIsEqual(const GrFragmentProcessor& other) const override; 397 bool onIsEqual(const GrFragmentProcessor& other) const override;
398 398
399 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; 399 void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
400 400
401 SkRRect fRRect; 401 SkRRect fRRect;
402 GrPrimitiveEdgeType fEdgeType; 402 GrPrimitiveEdgeType fEdgeType;
403 403
404 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 404 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
405 405
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 default: 608 default:
609 SkFAIL("RRect should always be simple or nine-patch."); 609 SkFAIL("RRect should always be simple or nine-patch.");
610 } 610 }
611 pdman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect. fBottom); 611 pdman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect. fBottom);
612 fPrevRRect = rrect; 612 fPrevRRect = rrect;
613 } 613 }
614 } 614 }
615 615
616 //////////////////////////////////////////////////////////////////////////////// //////////////////// 616 //////////////////////////////////////////////////////////////////////////////// ////////////////////
617 617
618 void EllipticalRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, 618 void EllipticalRRectEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
619 GrProcessorKeyBuilder* b) const { 619 GrProcessorKeyBuilder* b) cons t {
620 GLEllipticalRRectEffect::GenKey(*this, caps, b); 620 GLEllipticalRRectEffect::GenKey(*this, caps, b);
621 } 621 }
622 622
623 GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const { 623 GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLSLInstance() const {
624 return new GLEllipticalRRectEffect(*this); 624 return new GLEllipticalRRectEffect(*this);
625 } 625 }
626 626
627 ////////////////////////////////////////////////////////////////////////////// 627 //////////////////////////////////////////////////////////////////////////////
628 628
629 GrFragmentProcessor* GrRRectEffect::Create(GrPrimitiveEdgeType edgeType, const S kRRect& rrect) { 629 GrFragmentProcessor* GrRRectEffect::Create(GrPrimitiveEdgeType edgeType, const S kRRect& rrect) {
630 if (rrect.isRect()) { 630 if (rrect.isRect()) {
631 return GrConvexPolyEffect::Create(edgeType, rrect.getBounds()); 631 return GrConvexPolyEffect::Create(edgeType, rrect.getBounds());
632 } 632 }
633 633
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 if (rrect.isNinePatch()) { 715 if (rrect.isNinePatch()) {
716 return EllipticalRRectEffect::Create(edgeType, rrect); 716 return EllipticalRRectEffect::Create(edgeType, rrect);
717 } 717 }
718 return nullptr; 718 return nullptr;
719 } 719 }
720 } 720 }
721 } 721 }
722 722
723 return nullptr; 723 return nullptr;
724 } 724 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrPorterDuffXferProcessor.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698