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

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

Issue 732693002: Drawstate on stack (Closed) Base URL: https://skia.googlesource.com/skia.git@real_def_gp
Patch Set: tiny fix Created 6 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/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrDrawTarget.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 2011 Google Inc. 2 * Copyright 2011 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 GrDrawState_DEFINED 8 #ifndef GrDrawState_DEFINED
9 #define GrDrawState_DEFINED 9 #define GrDrawState_DEFINED
10 10
11 11
12 #include "GrBlend.h" 12 #include "GrBlend.h"
13 #include "GrDrawTargetCaps.h" 13 #include "GrDrawTargetCaps.h"
14 #include "GrGeometryProcessor.h" 14 #include "GrGeometryProcessor.h"
15 #include "GrGpuResourceRef.h" 15 #include "GrGpuResourceRef.h"
16 #include "GrProcessorStage.h" 16 #include "GrProcessorStage.h"
17 #include "GrProcOptInfo.h" 17 #include "GrProcOptInfo.h"
18 #include "GrRenderTarget.h" 18 #include "GrRenderTarget.h"
19 #include "GrStencil.h" 19 #include "GrStencil.h"
20 #include "SkMatrix.h" 20 #include "SkMatrix.h"
21 #include "effects/GrSimpleTextureEffect.h" 21 #include "effects/GrSimpleTextureEffect.h"
22 22
23 class GrDrawTargetCaps; 23 class GrDrawTargetCaps;
24 class GrOptDrawState; 24 class GrOptDrawState;
25 class GrPaint; 25 class GrPaint;
26 class GrTexture; 26 class GrTexture;
27 27
28 class GrDrawState : public SkRefCnt { 28 class GrDrawState {
29 public: 29 public:
30 SK_DECLARE_INST_COUNT(GrDrawState)
31
32 GrDrawState() { 30 GrDrawState() {
33 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 31 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
34 this->reset(); 32 this->reset();
35 } 33 }
36 34
37 GrDrawState(const SkMatrix& initialViewMatrix) { 35 GrDrawState(const SkMatrix& initialViewMatrix) {
38 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 36 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
39 this->reset(initialViewMatrix); 37 this->reset(initialViewMatrix);
40 } 38 }
41 39
42 /** 40 /**
43 * Copies another draw state. 41 * Copies another draw state.
44 **/ 42 **/
45 GrDrawState(const GrDrawState& state) : INHERITED() { 43 GrDrawState(const GrDrawState& state) {
46 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 44 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
47 *this = state; 45 *this = state;
48 } 46 }
49 47
50 /** 48 /**
51 * Copies another draw state with a preconcat to the view matrix. 49 * Copies another draw state with a preconcat to the view matrix.
52 **/ 50 **/
53 GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatrix); 51 GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatrix);
54 52
55 virtual ~GrDrawState(); 53 virtual ~GrDrawState();
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 // This is simply a different representation of info in fVertexAttribs and t hus does 863 // This is simply a different representation of info in fVertexAttribs and t hus does
866 // not need to be compared in op==. 864 // not need to be compared in op==.
867 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; 865 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ];
868 866
869 mutable GrProcOptInfo fColorProcInfo; 867 mutable GrProcOptInfo fColorProcInfo;
870 mutable GrProcOptInfo fCoverageProcInfo; 868 mutable GrProcOptInfo fCoverageProcInfo;
871 mutable bool fColorProcInfoValid; 869 mutable bool fColorProcInfoValid;
872 mutable bool fCoverageProcInfoValid; 870 mutable bool fCoverageProcInfoValid;
873 871
874 friend class GrOptDrawState; 872 friend class GrOptDrawState;
875
876 typedef SkRefCnt INHERITED;
877 }; 873 };
878 874
879 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); 875 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags);
880 876
881 #endif 877 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698