blob: 7cbd23058c60a52016aca2272b080f7ea5335e0e [file] [log] [blame]
reed@google.comac10a2d2010-12-22 21:39:39 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
reed@google.comac10a2d2010-12-22 21:39:39 +00006 */
7
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@google.comac10a2d2010-12-22 21:39:39 +000010#ifndef GrGpuGL_DEFINED
11#define GrGpuGL_DEFINED
12
bsalomon@google.comc1d2a582012-06-01 15:08:19 +000013#include "GrBinHashKey.h"
tomhudson@google.comd8f856c2012-05-10 12:13:36 +000014#include "GrDrawState.h"
15#include "GrGpu.h"
bsalomon@google.com89ec61e2012-02-10 20:05:18 +000016#include "GrGLContextInfo.h"
bsalomon@google.com4043ae22011-08-02 14:19:11 +000017#include "GrGLIndexBuffer.h"
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +000018#include "GrGLIRect.h"
bsalomon@google.com5739d2c2012-05-31 15:07:19 +000019#include "GrGLProgram.h"
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +000020#include "GrGLStencilBuffer.h"
21#include "GrGLTexture.h"
22#include "GrGLVertexBuffer.h"
bsalomon@google.comc1d2a582012-06-01 15:08:19 +000023#include "../GrTHashCache.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000024
25class GrGpuGL : public GrGpu {
26public:
bsalomon@google.com5739d2c2012-05-31 15:07:19 +000027 GrGpuGL(const GrGLContextInfo& ctxInfo);
reed@google.comac10a2d2010-12-22 21:39:39 +000028 virtual ~GrGpuGL();
29
bsalomon@google.com89ec61e2012-02-10 20:05:18 +000030 const GrGLInterface* glInterface() const {
31 return fGLContextInfo.interface();
32 }
tomhudson@google.comdd182cb2012-02-10 21:01:00 +000033 GrGLBinding glBinding() const { return fGLContextInfo.binding(); }
34 GrGLVersion glVersion() const { return fGLContextInfo.version(); }
35 GrGLSLGeneration glslGeneration() const {
bsalomon@google.com89ec61e2012-02-10 20:05:18 +000036 return fGLContextInfo.glslGeneration();
37 }
bsalomon@google.com0b77d682011-08-19 13:28:54 +000038
bsalomon@google.com56d11e02011-11-30 19:59:08 +000039 // GrGpu overrides
bsalomon@google.com0a97be22011-11-08 19:20:57 +000040 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig config)
bsalomon@google.com56d11e02011-11-30 19:59:08 +000041 const SK_OVERRIDE;
bsalomon@google.coma85449d2011-11-19 02:36:05 +000042 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig config)
bsalomon@google.com56d11e02011-11-30 19:59:08 +000043 const SK_OVERRIDE;
bsalomon@google.comc4364992011-11-07 15:54:49 +000044 virtual bool readPixelsWillPayForYFlip(
45 GrRenderTarget* renderTarget,
46 int left, int top,
47 int width, int height,
48 GrPixelConfig config,
bsalomon@google.com56d11e02011-11-30 19:59:08 +000049 size_t rowBytes) const SK_OVERRIDE;
50 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE;
bsalomon@google.com75f9f252012-01-31 13:35:56 +000051
bsalomon@google.coma91e9232012-02-23 15:39:54 +000052 virtual bool canPreserveReadWriteUnpremulPixels() SK_OVERRIDE;
53
bsalomon@google.com5739d2c2012-05-31 15:07:19 +000054 virtual void abandonResources() SK_OVERRIDE;
55
56 bool programUnitTest();
57
bsalomon@google.com88939ae2011-12-14 15:58:11 +000058protected:
bsalomon@google.com6aa25c32011-04-27 19:55:29 +000059
bsalomon@google.coma4d8fc22012-05-21 13:21:46 +000060 enum TriState {
61 kNo_TriState,
62 kYes_TriState,
63 kUnknown_TriState
64 };
65
reed@google.comac10a2d2010-12-22 21:39:39 +000066 struct {
bsalomon@google.com1c13c962011-02-14 16:51:21 +000067 size_t fVertexOffset;
reed@google.comac10a2d2010-12-22 21:39:39 +000068 GrVertexLayout fVertexLayout;
69 const GrVertexBuffer* fVertexBuffer;
70 const GrIndexBuffer* fIndexBuffer;
bsalomon@google.com7acdb8e2011-02-11 14:07:02 +000071 bool fArrayPtrsDirty;
reed@google.comac10a2d2010-12-22 21:39:39 +000072 } fHWGeometryState;
73
bsalomon@google.coma91e9232012-02-23 15:39:54 +000074 enum UnpremulConversion {
75 kUpOnWrite_DownOnRead_UnpremulConversion,
76 kDownOnWrite_UpOnRead_UnpremulConversion
77 } fUnpremulConversion;
78
bsalomon@google.combcc84862012-05-22 15:44:03 +000079 // The current render target and textures are bound by GrGpuGL when it
80 // flushes state to GL. After the bindings occur the variables that track
81 // the current GL state are updated to reflect the new bindings. However,
82 // the GrGpuGL subclass may have subsequent GL state manipulation it must
83 // perform whenever RT or textures change. So the GrGpuGL will set these
84 // dirty flags when it changes the RT or texture bindings. The subclass can
85 // use them to trigger its dependent state flushing. The subclass should
86 // call resetDirtyFlags to zero these out after it has consumed them.
87 //
bsalomon@google.comf3fcbbe2012-05-21 22:15:46 +000088 // TODO: Merge GrGpuGLShaders into GrGpuGL and remove the need for these
bsalomon@google.combcc84862012-05-22 15:44:03 +000089 // flags.
bsalomon@google.comc6cf7232011-02-17 16:43:10 +000090 struct {
91 bool fRenderTargetChanged : 1;
bsalomon@google.comc6cf7232011-02-17 16:43:10 +000092 int fTextureChangedMask;
93 } fDirtyFlags;
tomhudson@google.com93813632011-10-27 20:21:16 +000094 GR_STATIC_ASSERT(8 * sizeof(int) >= GrDrawState::kNumStages);
bsalomon@google.comc6cf7232011-02-17 16:43:10 +000095
96 // clears the dirty flags
97 void resetDirtyFlags();
98
99 // last scissor / viewport scissor state seen by the GL.
bsalomon@google.com8895a7a2011-02-18 16:09:55 +0000100 struct {
101 bool fScissorEnabled;
102 GrGLIRect fScissorRect;
103 GrGLIRect fViewportRect;
104 } fHWBounds;
bsalomon@google.comc6cf7232011-02-17 16:43:10 +0000105
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000106 const GrGLCaps& glCaps() const { return fGLContextInfo.caps(); }
bsalomon@google.com88939ae2011-12-14 15:58:11 +0000107
bsalomon@google.com1c13c962011-02-14 16:51:21 +0000108 // GrGpu overrides
bsalomon@google.com1bf1c212011-11-05 12:18:58 +0000109 virtual void onResetContext() SK_OVERRIDE;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000110
bsalomon@google.comfea37b52011-04-25 15:51:06 +0000111 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
bsalomon@google.combcdbbe62011-04-12 15:40:00 +0000112 const void* srcData,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000113 size_t rowBytes) SK_OVERRIDE;
bsalomon@google.combcdbbe62011-04-12 15:40:00 +0000114 virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000115 bool dynamic) SK_OVERRIDE;
bsalomon@google.combcdbbe62011-04-12 15:40:00 +0000116 virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000117 bool dynamic) SK_OVERRIDE;
118 virtual GrTexture* onCreatePlatformTexture(
119 const GrPlatformTextureDesc& desc) SK_OVERRIDE;
120 virtual GrRenderTarget* onCreatePlatformRenderTarget(
121 const GrPlatformRenderTargetDesc& desc) SK_OVERRIDE;
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +0000122 virtual bool createStencilBufferForRenderTarget(GrRenderTarget* rt,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000123 int width,
124 int height) SK_OVERRIDE;
125 virtual bool attachStencilBufferToRenderTarget(
126 GrStencilBuffer* sb,
127 GrRenderTarget* rt) SK_OVERRIDE;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000128
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000129 virtual void onClear(const GrIRect* rect, GrColor color) SK_OVERRIDE;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000130
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000131 virtual void onForceRenderTargetFlush() SK_OVERRIDE;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000132
bsalomon@google.com5877ffd2011-04-11 17:58:48 +0000133 virtual bool onReadPixels(GrRenderTarget* target,
bsalomon@google.comc6980972011-11-02 19:57:21 +0000134 int left, int top,
135 int width, int height,
136 GrPixelConfig,
bsalomon@google.comc4364992011-11-07 15:54:49 +0000137 void* buffer,
138 size_t rowBytes,
139 bool invertY) SK_OVERRIDE;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000140
bsalomon@google.com6f379512011-11-16 20:36:03 +0000141 virtual void onWriteTexturePixels(GrTexture* texture,
142 int left, int top, int width, int height,
143 GrPixelConfig config, const void* buffer,
144 size_t rowBytes) SK_OVERRIDE;
145
bsalomon@google.com75f9f252012-01-31 13:35:56 +0000146 virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE;
147
148
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000149 virtual void onGpuDrawIndexed(GrPrimitiveType type,
150 uint32_t startVertex,
151 uint32_t startIndex,
152 uint32_t vertexCount,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000153 uint32_t indexCount) SK_OVERRIDE;
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000154 virtual void onGpuDrawNonIndexed(GrPrimitiveType type,
155 uint32_t vertexCount,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000156 uint32_t numVertices) SK_OVERRIDE;
157 virtual void enableScissoring(const GrIRect& rect) SK_OVERRIDE;
158 virtual void disableScissor() SK_OVERRIDE;
robertphillips@google.com730ebe52012-04-16 16:33:13 +0000159
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000160 virtual void clearStencil() SK_OVERRIDE;
161 virtual void clearStencilClip(const GrIRect& rect,
162 bool insideClip) SK_OVERRIDE;
bsalomon@google.com5739d2c2012-05-31 15:07:19 +0000163 virtual bool flushGraphicsState(GrPrimitiveType type) SK_OVERRIDE;
164 virtual void setupGeometry(int* startVertex,
165 int* startIndex,
166 int vertexCount,
167 int indexCount) SK_OVERRIDE;
168
bsalomon@google.com5782d712011-01-21 21:03:59 +0000169
bsalomon@google.com1c13c962011-02-14 16:51:21 +0000170 // binds texture unit in GL
bsalomon@google.com8531c1c2011-01-13 19:52:45 +0000171 void setTextureUnit(int unitIdx);
reed@google.comac10a2d2010-12-22 21:39:39 +0000172
bsalomon@google.com1c13c962011-02-14 16:51:21 +0000173 // binds appropriate vertex and index buffers, also returns any extra
174 // extra verts or indices to offset by.
175 void setBuffers(bool indexed,
176 int* extraVertexOffset,
177 int* extraIndexOffset);
bsalomon@google.com7acdb8e2011-02-11 14:07:02 +0000178
reed@google.comac10a2d2010-12-22 21:39:39 +0000179 // flushes state that is common to fixed and programmable GL
180 // dither
181 // line smoothing
reed@google.comac10a2d2010-12-22 21:39:39 +0000182 // texture binding
183 // sampler state (filtering, tiling)
184 // FBO binding
185 // line width
bsalomon@google.comffca4002011-02-22 20:34:01 +0000186 bool flushGLStateCommon(GrPrimitiveType type);
reed@google.comac10a2d2010-12-22 21:39:39 +0000187
bsalomon@google.com86c1f712011-10-12 14:54:26 +0000188 // Subclasses should call this to flush the blend state.
189 // The params should be the final coeffecients to apply
190 // (after any blending optimizations or dual source blending considerations
191 // have been accounted for).
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000192 void flushBlend(GrPrimitiveType type,
193 GrBlendCoeff srcCoeff,
194 GrBlendCoeff dstCoeff);
195
bsalomon@google.com89ec61e2012-02-10 20:05:18 +0000196 bool hasExtension(const char* ext) const {
197 return fGLContextInfo.hasExtension(ext);
bsalomon@google.com96399942012-02-13 14:39:16 +0000198 }
199
200 const GrGLContextInfo& glContextInfo() const { return fGLContextInfo; }
bsalomon@google.com2c17fcd2011-07-06 17:47:02 +0000201
bsalomon@google.com99621082011-11-15 16:47:16 +0000202 // adjusts texture matrix to account for orientation
bsalomon@google.comc6cf7232011-02-17 16:43:10 +0000203 static void AdjustTextureMatrix(const GrGLTexture* texture,
204 GrSamplerState::SampleMode mode,
205 GrMatrix* matrix);
bsalomon@google.com88939ae2011-12-14 15:58:11 +0000206
207 // subclass may try to take advantage of identity tex matrices.
208 // This helper determines if matrix will be identity after all
209 // adjustments are applied.
210 static bool TextureMatrixIsIdentity(const GrGLTexture* texture,
211 const GrSamplerState& sampler);
212
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000213 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff);
bsalomon@google.com080773c2011-03-15 19:09:25 +0000214
bsalomon@google.com8531c1c2011-01-13 19:52:45 +0000215private:
bsalomon@google.com5739d2c2012-05-31 15:07:19 +0000216 // for readability of function impls
217 typedef GrGLProgram::ProgramDesc ProgramDesc;
218 typedef ProgramDesc::StageDesc StageDesc;
219 typedef GrGLProgram::CachedData CachedData;
220
bsalomon@google.comc1d2a582012-06-01 15:08:19 +0000221 class ProgramCache : public ::GrNoncopyable {
222 public:
223 ProgramCache(const GrGLContextInfo& gl);
224 ~ProgramCache();
bsalomon@google.com5739d2c2012-05-31 15:07:19 +0000225
bsalomon@google.comc1d2a582012-06-01 15:08:19 +0000226 void abandon();
227 void invalidateViewMatrices();
228 CachedData* getProgramData(const GrGLProgram& desc,
229 GrCustomStage** stages);
230 private:
231 enum {
232 kKeySize = GrGLProgram::kProgramKeySize,
233 // We may actually have kMaxEntries+1 shaders in the GL context
234 // because we create a new shader before evicting from the cache.
235 kMaxEntries = 32
236 };
237
238 class Entry;
239 typedef GrBinHashKey<Entry, kKeySize> ProgramHashKey;
240
241 class Entry : public ::GrNoncopyable {
242 public:
243 Entry() {}
244 void copyAndTakeOwnership(Entry& entry);
245 int compare(const ProgramHashKey& key) const {
246 return fKey.compare(key);
247 }
248
249 public:
250 CachedData fProgramData;
251 ProgramHashKey fKey;
252 unsigned int fLRUStamp;
253 };
254
255 GrTHashTable<Entry, ProgramHashKey, 8> fHashCache;
256
257 Entry fEntries[kMaxEntries];
258 int fCount;
259 unsigned int fCurrLRUStamp;
260 const GrGLContextInfo& fGL;
261 };
bsalomon@google.com5739d2c2012-05-31 15:07:19 +0000262
263 // sets the texture matrix uniform for currently bound program
264 void flushTextureMatrix(int stage);
265
266 // sets the texture domain uniform for currently bound program
267 void flushTextureDomain(int stage);
268
269 // sets the color specified by GrDrawState::setColor()
270 void flushColor(GrColor color);
271
272 // sets the color specified by GrDrawState::setCoverage()
273 void flushCoverage(GrColor color);
274
275 // sets the MVP matrix uniform for currently bound program
276 void flushViewMatrix();
277
278 // flushes the parameters to two point radial gradient
279 void flushRadial2(int stage);
280
281 // flushes the parameters for convolution
282 void flushConvolution(int stage);
283
284 // flushes the normalized texel size
285 void flushTexelSize(int stage);
286
287 // flushes the color matrix
288 void flushColorMatrix();
289
290 static void DeleteProgram(const GrGLInterface* gl,
291 CachedData* programData);
292
293 void buildProgram(GrPrimitiveType typeBlend,
294 BlendOptFlags blendOpts,
295 GrBlendCoeff dstCoeff,
296 GrCustomStage** customStages);
297
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000298 // Inits GrDrawTarget::Caps, sublcass may enable additional caps.
bsalomon@google.com18c9c192011-09-22 21:01:31 +0000299 void initCaps();
300
301 void initFSAASupport();
bsalomon@google.com6aa25c32011-04-27 19:55:29 +0000302
bsalomon@google.com2c17fcd2011-07-06 17:47:02 +0000303 // determines valid stencil formats
bsalomon@google.com18c9c192011-09-22 21:01:31 +0000304 void initStencilFormats();
bsalomon@google.com2c17fcd2011-07-06 17:47:02 +0000305
reed@google.comac10a2d2010-12-22 21:39:39 +0000306 // notify callbacks to update state tracking when related
307 // objects are bound to GL or deleted outside of the class
308 void notifyVertexBufferBind(const GrGLVertexBuffer* buffer);
309 void notifyVertexBufferDelete(const GrGLVertexBuffer* buffer);
310 void notifyIndexBufferBind(const GrGLIndexBuffer* buffer);
311 void notifyIndexBufferDelete(const GrGLIndexBuffer* buffer);
reed@google.comac10a2d2010-12-22 21:39:39 +0000312 void notifyTextureDelete(GrGLTexture* texture);
313 void notifyRenderTargetDelete(GrRenderTarget* renderTarget);
bsalomon@google.com5782d712011-01-21 21:03:59 +0000314
bsalomon@google.com8531c1c2011-01-13 19:52:45 +0000315 void setSpareTextureUnit();
reed@google.comac10a2d2010-12-22 21:39:39 +0000316
bsalomon@google.com8295dc12011-05-02 12:53:34 +0000317 // bound is region that may be modified and therefore has to be resolved.
318 // NULL means whole target. Can be an empty rect.
319 void flushRenderTarget(const GrIRect* bound);
reed@google.comac10a2d2010-12-22 21:39:39 +0000320 void flushStencil();
bsalomon@google.comf954d8d2011-04-06 17:50:02 +0000321 void flushAAState(GrPrimitiveType type);
bsalomon@google.com0650e812011-04-08 18:07:53 +0000322
bsalomon@google.com280e99f2012-01-05 16:17:38 +0000323 bool configToGLFormats(GrPixelConfig config,
324 bool getSizedInternal,
325 GrGLenum* internalFormat,
326 GrGLenum* externalFormat,
327 GrGLenum* externalType);
bsalomon@google.com6f379512011-11-16 20:36:03 +0000328 // helper for onCreateTexture and writeTexturePixels
bsalomon@google.com136f55b2011-11-28 18:34:44 +0000329 bool uploadTexData(const GrGLTexture::Desc& desc,
bsalomon@google.com1e0e6072011-11-28 18:49:37 +0000330 bool isNewTexture,
bsalomon@google.com6f379512011-11-16 20:36:03 +0000331 int left, int top, int width, int height,
332 GrPixelConfig dataConfig,
333 const void* data,
334 size_t rowBytes);
bsalomon@google.com0650e812011-04-08 18:07:53 +0000335
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +0000336 bool createRenderTargetObjects(int width, int height,
337 GrGLuint texID,
338 GrGLRenderTarget::Desc* desc);
339
robertphillips@google.com99a5ac02012-04-10 19:26:38 +0000340 void fillInConfigRenderableTable();
341
reed@google.comac10a2d2010-12-22 21:39:39 +0000342 friend class GrGLVertexBuffer;
343 friend class GrGLIndexBuffer;
344 friend class GrGLTexture;
345 friend class GrGLRenderTarget;
346
bsalomon@google.com89ec61e2012-02-10 20:05:18 +0000347 GrGLContextInfo fGLContextInfo;
bsalomon@google.com2c17fcd2011-07-06 17:47:02 +0000348
bsalomon@google.com5739d2c2012-05-31 15:07:19 +0000349 // GL program-related state
350 ProgramCache* fProgramCache;
351 CachedData* fProgramData;
352 GrGLuint fHWProgramID;
353 GrColor fHWConstAttribColor;
354 GrColor fHWConstAttribCoverage;
355 GrGLProgram fCurrentProgram;
356 // If we get rid of fixed function subclass this should move
357 // to the GLCaps struct in parent class
358 GrGLint fMaxVertexAttribs;
359
bsalomon@google.com8531c1c2011-01-13 19:52:45 +0000360 int fActiveTextureUnitIdx;
bsalomon@google.com5782d712011-01-21 21:03:59 +0000361
bsalomon@google.coma4d8fc22012-05-21 13:21:46 +0000362 struct {
363 GrBlendCoeff fSrcCoeff;
364 GrBlendCoeff fDstCoeff;
365 GrColor fConstColor;
366 bool fConstColorValid;
367 TriState fEnabled;
368
369 void invalidate() {
370 fSrcCoeff = kInvalid_BlendCoeff;
371 fDstCoeff = kInvalid_BlendCoeff;
372 fConstColorValid = false;
373 fEnabled = kUnknown_TriState;
374 }
375 } fHWBlendState;
376
bsalomon@google.com4d5f3fe2012-05-21 17:11:44 +0000377 struct {
378 TriState fMSAAEnabled;
379 TriState fSmoothLineEnabled;
380 void invalidate() {
381 fMSAAEnabled = kUnknown_TriState;
382 fSmoothLineEnabled = kUnknown_TriState;
383 }
384 } fHWAAState;
385
bsalomon@google.com457b8a32012-05-21 21:19:58 +0000386 // The high bit of the stencil buffer is used for clipping. This enum is
387 // used to track whether the clip bit of the stencil buffer is being used,
388 // manipulated, or neither.
389 enum StencilClipMode {
390 // Draw to the clip bit of the stencil buffer
391 kModifyClip_StencilClipMode,
392 // Clip against the existing representation of the clip in the high bit
393 // of the stencil buffer.
394 kUseClip_StencilClipMode,
395 // Neither writing to nor clipping against the clip bit.
396 kIgnoreClip_StencilClipMode,
397 // Unknown state of HW
398 kInvalid_StencilClipMode,
399 };
400 StencilClipMode fHWStencilClipMode;
401 GrStencilSettings fHWStencilSettings;
402
bsalomon@google.comc811ea32012-05-21 15:33:09 +0000403 GrDrawState::DrawFace fHWDrawFace;
404 TriState fHWWriteToColor;
405 TriState fHWDitherEnabled;
406 GrRenderTarget* fHWBoundRenderTarget;
407 GrTexture* fHWBoundTextures[GrDrawState::kNumStages];
bsalomon@google.com978c8c62012-05-21 14:45:49 +0000408
bsalomon@google.comfe676522011-06-17 18:12:21 +0000409 // we record what stencil format worked last time to hopefully exit early
410 // from our loop that tries stencil formats and calls check fb status.
411 int fLastSuccessfulStencilFmtIdx;
412
bsalomon@google.coma91e9232012-02-23 15:39:54 +0000413 enum CanPreserveUnpremulRoundtrip {
414 kUnknown_CanPreserveUnpremulRoundtrip,
415 kNo_CanPreserveUnpremulRoundtrip,
416 kYes_CanPreserveUnpremulRoundtrip,
417 } fCanPreserveUnpremulRoundtrip;
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000418
bsalomon@google.com18c9c192011-09-22 21:01:31 +0000419 bool fPrintedCaps;
420
reed@google.comac10a2d2010-12-22 21:39:39 +0000421 typedef GrGpu INHERITED;
422};
423
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000424#endif
bsalomon@google.comfe676522011-06-17 18:12:21 +0000425