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

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

Issue 712223002: Combine similar DrawPaths calls in GrInOrderDrawBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 private: 136 private:
137 GrDrawState* fDrawState; 137 GrDrawState* fDrawState;
138 const GrVertexAttrib* fVAPtr; 138 const GrVertexAttrib* fVAPtr;
139 int fVACount; 139 int fVACount;
140 size_t fVAStride; 140 size_t fVAStride;
141 }; 141 };
142 142
143 /// @} 143 /// @}
144 144
145 /** 145 /**
146 * Determines whether src alpha is guaranteed to be one for all src pixels
147 */
148 bool srcAlphaWillBeOne() const;
Chris Dalton 2014/11/11 00:44:45 Move here to make public
149
150 /**
146 * Depending on features available in the underlying 3D API and the color bl end mode requested 151 * Depending on features available in the underlying 3D API and the color bl end mode requested
147 * it may or may not be possible to correctly blend with fractional pixel co verage generated by 152 * it may or may not be possible to correctly blend with fractional pixel co verage generated by
148 * the fragment shader. 153 * the fragment shader.
149 * 154 *
150 * This function considers the current draw state and the draw target's capa bilities to 155 * This function considers the current draw state and the draw target's capa bilities to
151 * determine whether coverage can be handled correctly. This function assume s that the caller 156 * determine whether coverage can be handled correctly. This function assume s that the caller
152 * intends to specify fractional pixel coverage (via setCoverage(), through a coverage vertex 157 * intends to specify fractional pixel coverage (via setCoverage(), through a coverage vertex
153 * attribute, or a coverage effect) but may not have specified it yet. 158 * attribute, or a coverage effect) but may not have specified it yet.
154 */ 159 */
155 bool couldApplyCoverage(const GrDrawTargetCaps& caps) const; 160 bool couldApplyCoverage(const GrDrawTargetCaps& caps) const;
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 * Subclasses of GrDrawTarget that actually draw (as opposed to those that j ust buffer for 802 * Subclasses of GrDrawTarget that actually draw (as opposed to those that j ust buffer for
798 * playback) must call this function and respect the flags that replace the output color. 803 * playback) must call this function and respect the flags that replace the output color.
799 * 804 *
800 * If the cached BlendOptFlags does not have the invalidate bit set, then ge tBlendOpts will 805 * If the cached BlendOptFlags does not have the invalidate bit set, then ge tBlendOpts will
801 * simply returned the cached flags and coefficients. Otherwise it will calc ulate the values. 806 * simply returned the cached flags and coefficients. Otherwise it will calc ulate the values.
802 */ 807 */
803 BlendOptFlags getBlendOpts(bool forceCoverage = false, 808 BlendOptFlags getBlendOpts(bool forceCoverage = false,
804 GrBlendCoeff* srcCoeff = NULL, 809 GrBlendCoeff* srcCoeff = NULL,
805 GrBlendCoeff* dstCoeff = NULL) const; 810 GrBlendCoeff* dstCoeff = NULL) const;
806 811
807 /**
808 * Determines whether src alpha is guaranteed to be one for all src pixels
809 */
810 bool srcAlphaWillBeOne() const;
811
812 void invalidateOptState() const; 812 void invalidateOptState() const;
813 813
814 void onReset(const SkMatrix* initialViewMatrix); 814 void onReset(const SkMatrix* initialViewMatrix);
815 815
816 // Some of the auto restore objects assume that no effects are removed durin g their lifetime. 816 // Some of the auto restore objects assume that no effects are removed durin g their lifetime.
817 // This is used to assert that this condition holds. 817 // This is used to assert that this condition holds.
818 SkDEBUGCODE(int fBlockEffectRemovalCnt;) 818 SkDEBUGCODE(int fBlockEffectRemovalCnt;)
819 819
820 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz e_t stride); 820 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz e_t stride);
821 821
(...skipping 29 matching lines...) Expand all
851 mutable uint32_t fCachedCapsID; 851 mutable uint32_t fCachedCapsID;
852 852
853 friend class GrOptDrawState; 853 friend class GrOptDrawState;
854 854
855 typedef SkRefCnt INHERITED; 855 typedef SkRefCnt INHERITED;
856 }; 856 };
857 857
858 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); 858 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags);
859 859
860 #endif 860 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698