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

Side by Side Diff: src/gpu/GrPendingFragmentStage.h

Issue 1229303003: Another trivial cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 months 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/effects/gradients/SkGradientShaderPriv.h ('k') | src/gpu/GrPipelineBuilder.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 #ifndef GrPendingProcessorStage_DEFINED 8 #ifndef GrPendingFragmentStage_DEFINED
9 #define GrPendingProcessorStage_DEFINED 9 #define GrPendingFragmentStage_DEFINED
10 10
11 #include "GrFragmentStage.h" 11 #include "GrStagedProcessor.h"
12 #include "GrCoordTransform.h"
13 #include "GrFragmentProcessor.h"
14 #include "GrPendingProgramElement.h" 12 #include "GrPendingProgramElement.h"
15 13
16 /** 14 /**
17 * This a baked variant of GrFragmentStage, as recorded in GrOptDrawState. 15 * This a baked variant of GrFragmentStage, as recorded in GrPipeline
18 */ 16 */
19 class GrPendingFragmentStage { 17 class GrPendingFragmentStage : public GrStagedProcessor<GrPendingProgramElement> {
20 public: 18 public:
21 GrPendingFragmentStage(const GrFragmentStage& stage) : fProc(stage.processor ()) {} 19 GrPendingFragmentStage(const GrFragmentStage& stage) {
22 20 INHERITED::fProc.reset(stage.processor());
23 GrPendingFragmentStage(const GrPendingFragmentStage& that) { *this = that; }
24
25 GrPendingFragmentStage& operator=(const GrPendingFragmentStage& that) {
26 fProc.reset(that.fProc.get());
27 return *this;
28 } 21 }
29 22
30 bool operator==(const GrPendingFragmentStage& that) const { 23 private:
31 return this->processor()->isEqual(*that.processor()); 24 typedef GrStagedProcessor<GrPendingProgramElement> INHERITED;
32 } 25 };
33 26
34 bool operator!=(const GrPendingFragmentStage& that) const { return !(*this = = that); }
35
36 /**
37 * For a coord transform on the fragment processor, does it or the coord cha nge matrix (if
38 * relevant) contain perspective?
39 */
40 bool isPerspectiveCoordTransform(int matrixIndex) const {
41 const GrCoordTransform& coordTransform = this->processor()->coordTransfo rm(matrixIndex);
42 uint32_t type = coordTransform.getMatrix().getType();
43 return SkToBool(SkMatrix::kPerspective_Mask & type);
44 }
45
46 const char* name() const { return fProc->name(); }
47
48 const GrFragmentProcessor* processor() const { return fProc.get(); }
49
50 protected:
51 GrPendingProgramElement<const GrFragmentProcessor> fProc;
52 };
53 #endif 27 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShaderPriv.h ('k') | src/gpu/GrPipelineBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698