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

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

Issue 1101663007: Make non-AA hairline stroke rects snap to pixels centers so they close. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/gpu/GrContext.cpp ('k') | src/gpu/GrPipeline.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 GrPipeline_DEFINED 8 #ifndef GrPipeline_DEFINED
9 #define GrPipeline_DEFINED 9 #define GrPipeline_DEFINED
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 * @return The currently set render target. 73 * @return The currently set render target.
74 */ 74 */
75 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } 75 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); }
76 76
77 const GrStencilSettings& getStencil() const { return fStencilSettings; } 77 const GrStencilSettings& getStencil() const { return fStencilSettings; }
78 78
79 const GrScissorState& getScissorState() const { return fScissorState; } 79 const GrScissorState& getScissorState() const { return fScissorState; }
80 80
81 bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); } 81 bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); }
82 bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); } 82 bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); }
83 bool snapVerticesToPixelCenters() const { return SkToBool(fFlags & kSnapVert ices_Flag); }
83 // Skip any draws that refer to this pipeline (they should be a no-op). 84 // Skip any draws that refer to this pipeline (they should be a no-op).
84 bool mustSkip() const { return NULL == this->getRenderTarget(); } 85 bool mustSkip() const { return NULL == this->getRenderTarget(); }
85 86
86 /** 87 /**
87 * Gets whether the target is drawing clockwise, counterclockwise, 88 * Gets whether the target is drawing clockwise, counterclockwise,
88 * or both faces. 89 * or both faces.
89 * @return the current draw face(s). 90 * @return the current draw face(s).
90 */ 91 */
91 GrPipelineBuilder::DrawFace getDrawFace() const { return fDrawFace; } 92 GrPipelineBuilder::DrawFace getDrawFace() const { return fDrawFace; }
92 93
(...skipping 19 matching lines...) Expand all
112 * Calculates the primary and secondary output types of the shader. For cert ain output types 113 * Calculates the primary and secondary output types of the shader. For cert ain output types
113 * the function may adjust the blend coefficients. After this function is ca lled the src and dst 114 * the function may adjust the blend coefficients. After this function is ca lled the src and dst
114 * blend coeffs will represent those used by backend API. 115 * blend coeffs will represent those used by backend API.
115 */ 116 */
116 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla gs, 117 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla gs,
117 const GrDrawTargetCaps&); 118 const GrDrawTargetCaps&);
118 119
119 enum Flags { 120 enum Flags {
120 kDither_Flag = 0x1, 121 kDither_Flag = 0x1,
121 kHWAA_Flag = 0x2, 122 kHWAA_Flag = 0x2,
123 kSnapVertices_Flag = 0x4,
122 }; 124 };
123 125
124 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; 126 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget;
125 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; 127 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray;
126 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; 128 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor;
127 RenderTarget fRenderTarget; 129 RenderTarget fRenderTarget;
128 GrScissorState fScissorState; 130 GrScissorState fScissorState;
129 GrStencilSettings fStencilSettings; 131 GrStencilSettings fStencilSettings;
130 GrPipelineBuilder::DrawFace fDrawFace; 132 GrPipelineBuilder::DrawFace fDrawFace;
131 uint32_t fFlags; 133 uint32_t fFlags;
132 ProgramXferProcessor fXferProcessor; 134 ProgramXferProcessor fXferProcessor;
133 FragmentStageArray fFragmentStages; 135 FragmentStageArray fFragmentStages;
134 bool fReadsFragPosition; 136 bool fReadsFragPosition;
135 GrPipelineInfo fInitBT; 137 GrPipelineInfo fInitBT;
136 138
137 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin. 139 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin.
138 int fNumColorStages; 140 int fNumColorStages;
139 141
140 GrProgramDesc fDesc; 142 GrProgramDesc fDesc;
141 143
142 typedef SkRefCnt INHERITED; 144 typedef SkRefCnt INHERITED;
143 }; 145 };
144 146
145 #endif 147 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrPipeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698