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

Side by Side Diff: include/gpu/GrRenderTarget.h

Issue 1232103002: Enable stencil clipping in mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Predefined sample locations, glcaps, render target priv Created 5 years, 3 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
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 GrRenderTarget_DEFINED 8 #ifndef GrRenderTarget_DEFINED
9 #define GrRenderTarget_DEFINED 9 #define GrRenderTarget_DEFINED
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 /** 76 /**
77 * @return the number of stencil samples-per-pixel, or zero if non-MSAA. 77 * @return the number of stencil samples-per-pixel, or zero if non-MSAA.
78 */ 78 */
79 int numStencilSamples() const { 79 int numStencilSamples() const {
80 return fDesc.fSampleCnt; 80 return fDesc.fSampleCnt;
81 } 81 }
82 82
83 /** 83 /**
84 * @return the number of actual raster samples-per-pixel, or zero if non-MSA A.
85 */
86 int numRasterSamples() const {
87 return fStencilAttachment ? this->numStencilSamples() : this->numColorSa mples();
88 }
89
90 /**
84 * @return true if the surface is mixed sampled, false otherwise. 91 * @return true if the surface is mixed sampled, false otherwise.
85 */ 92 */
86 bool hasMixedSamples() const { 93 bool hasMixedSamples() const {
87 SkASSERT(kStencil_SampleConfig != fSampleConfig || 94 SkASSERT(kStencil_SampleConfig != fSampleConfig ||
88 this->isStencilBufferMultisampled()); 95 this->isStencilBufferMultisampled());
89 return kStencil_SampleConfig == fSampleConfig; 96 return kStencil_SampleConfig == fSampleConfig;
90 } 97 }
91 98
92 /** 99 /**
93 * Call to indicate the multisample contents were modified such that the 100 * Call to indicate the multisample contents were modified such that the
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // Allows the backends to perform any additional work that is required for a ttaching a 175 // Allows the backends to perform any additional work that is required for a ttaching a
169 // GrStencilAttachment. When this is called, the GrStencilAttachment has alr eady been put onto 176 // GrStencilAttachment. When this is called, the GrStencilAttachment has alr eady been put onto
170 // the GrRenderTarget. This function must return false if any failures occur when completing the 177 // the GrRenderTarget. This function must return false if any failures occur when completing the
171 // stencil attachment. 178 // stencil attachment.
172 virtual bool completeStencilAttachment() = 0; 179 virtual bool completeStencilAttachment() = 0;
173 180
174 friend class GrRenderTargetPriv; 181 friend class GrRenderTargetPriv;
175 182
176 GrStencilAttachment* fStencilAttachment; 183 GrStencilAttachment* fStencilAttachment;
177 SampleConfig fSampleConfig; 184 SampleConfig fSampleConfig;
185 // Configures sample locations to be either default or programmable, if MSAA .
186 bool fProgrammableSampleLocationsEnabled;
187 // True if sample locations colocated at pixel center are currently in use, false if default
188 // sample locations are currently in use.
189 bool fUsesCenteredSampleLocations;
178 190
179 SkIRect fResolveRect; 191 SkIRect fResolveRect;
180 192
181 typedef GrSurface INHERITED; 193 typedef GrSurface INHERITED;
182 }; 194 };
183 195
184 196
185 #endif 197 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrCaps.h ('k') | include/gpu/gl/GrGLFunctions.h » ('j') | src/gpu/gl/GrGLDefines.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698