epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 11 | #ifndef GrGpuGL_DEFINED |
| 12 | #define GrGpuGL_DEFINED |
| 13 | |
tomhudson@google.com | dd182cb | 2012-02-10 21:01:00 +0000 | [diff] [blame] | 14 | #include "../GrDrawState.h" |
| 15 | #include "../GrGpu.h" |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 16 | #include "GrGLContextInfo.h" |
bsalomon@google.com | 4043ae2 | 2011-08-02 14:19:11 +0000 | [diff] [blame] | 17 | #include "GrGLIndexBuffer.h" |
bsalomon@google.com | 81c3f8d | 2011-08-03 15:18:33 +0000 | [diff] [blame] | 18 | #include "GrGLIRect.h" |
| 19 | #include "GrGLStencilBuffer.h" |
| 20 | #include "GrGLTexture.h" |
| 21 | #include "GrGLVertexBuffer.h" |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 22 | |
| 23 | class GrGpuGL : public GrGpu { |
| 24 | public: |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 25 | virtual ~GrGpuGL(); |
| 26 | |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 27 | const GrGLInterface* glInterface() const { |
| 28 | return fGLContextInfo.interface(); |
| 29 | } |
tomhudson@google.com | dd182cb | 2012-02-10 21:01:00 +0000 | [diff] [blame] | 30 | GrGLBinding glBinding() const { return fGLContextInfo.binding(); } |
| 31 | GrGLVersion glVersion() const { return fGLContextInfo.version(); } |
| 32 | GrGLSLGeneration glslGeneration() const { |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 33 | return fGLContextInfo.glslGeneration(); |
| 34 | } |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 35 | |
bsalomon@google.com | 56d11e0 | 2011-11-30 19:59:08 +0000 | [diff] [blame] | 36 | // GrGpu overrides |
bsalomon@google.com | 0a97be2 | 2011-11-08 19:20:57 +0000 | [diff] [blame] | 37 | virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig config) |
bsalomon@google.com | 56d11e0 | 2011-11-30 19:59:08 +0000 | [diff] [blame] | 38 | const SK_OVERRIDE; |
bsalomon@google.com | a85449d | 2011-11-19 02:36:05 +0000 | [diff] [blame] | 39 | virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig config) |
bsalomon@google.com | 56d11e0 | 2011-11-30 19:59:08 +0000 | [diff] [blame] | 40 | const SK_OVERRIDE; |
bsalomon@google.com | c436499 | 2011-11-07 15:54:49 +0000 | [diff] [blame] | 41 | virtual bool readPixelsWillPayForYFlip( |
| 42 | GrRenderTarget* renderTarget, |
| 43 | int left, int top, |
| 44 | int width, int height, |
| 45 | GrPixelConfig config, |
bsalomon@google.com | 56d11e0 | 2011-11-30 19:59:08 +0000 | [diff] [blame] | 46 | size_t rowBytes) const SK_OVERRIDE; |
| 47 | virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; |
bsalomon@google.com | 75f9f25 | 2012-01-31 13:35:56 +0000 | [diff] [blame] | 48 | |
bsalomon@google.com | a91e923 | 2012-02-23 15:39:54 +0000 | [diff] [blame^] | 49 | virtual bool canPreserveReadWriteUnpremulPixels() SK_OVERRIDE; |
| 50 | |
bsalomon@google.com | 88939ae | 2011-12-14 15:58:11 +0000 | [diff] [blame] | 51 | protected: |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 52 | GrGpuGL(const GrGLContextInfo& ctxInfo); |
bsalomon@google.com | 6aa25c3 | 2011-04-27 19:55:29 +0000 | [diff] [blame] | 53 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 54 | struct { |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 55 | size_t fVertexOffset; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 56 | GrVertexLayout fVertexLayout; |
| 57 | const GrVertexBuffer* fVertexBuffer; |
| 58 | const GrIndexBuffer* fIndexBuffer; |
bsalomon@google.com | 7acdb8e | 2011-02-11 14:07:02 +0000 | [diff] [blame] | 59 | bool fArrayPtrsDirty; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 60 | } fHWGeometryState; |
| 61 | |
bsalomon@google.com | f954d8d | 2011-04-06 17:50:02 +0000 | [diff] [blame] | 62 | struct AAState { |
| 63 | bool fMSAAEnabled; |
| 64 | bool fSmoothLineEnabled; |
| 65 | } fHWAAState; |
| 66 | |
bsalomon@google.com | a91e923 | 2012-02-23 15:39:54 +0000 | [diff] [blame^] | 67 | enum UnpremulConversion { |
| 68 | kUpOnWrite_DownOnRead_UnpremulConversion, |
| 69 | kDownOnWrite_UpOnRead_UnpremulConversion |
| 70 | } fUnpremulConversion; |
| 71 | |
tomhudson@google.com | 9381363 | 2011-10-27 20:21:16 +0000 | [diff] [blame] | 72 | GrDrawState fHWDrawState; |
| 73 | bool fHWStencilClip; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 74 | |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 75 | // As flush of GL state proceeds it updates fHDrawState |
| 76 | // to reflect the new state. Later parts of the state flush |
| 77 | // may perform cascaded changes but cannot refer to fHWDrawState. |
| 78 | // These code paths can refer to the dirty flags. Subclass should |
| 79 | // call resetDirtyFlags after its flush is complete |
| 80 | struct { |
| 81 | bool fRenderTargetChanged : 1; |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 82 | int fTextureChangedMask; |
| 83 | } fDirtyFlags; |
tomhudson@google.com | 9381363 | 2011-10-27 20:21:16 +0000 | [diff] [blame] | 84 | GR_STATIC_ASSERT(8 * sizeof(int) >= GrDrawState::kNumStages); |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 85 | |
| 86 | // clears the dirty flags |
| 87 | void resetDirtyFlags(); |
| 88 | |
| 89 | // last scissor / viewport scissor state seen by the GL. |
bsalomon@google.com | 8895a7a | 2011-02-18 16:09:55 +0000 | [diff] [blame] | 90 | struct { |
| 91 | bool fScissorEnabled; |
| 92 | GrGLIRect fScissorRect; |
| 93 | GrGLIRect fViewportRect; |
| 94 | } fHWBounds; |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 95 | |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 96 | const GrGLCaps& glCaps() const { return fGLContextInfo.caps(); } |
bsalomon@google.com | 88939ae | 2011-12-14 15:58:11 +0000 | [diff] [blame] | 97 | |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 98 | // GrGpu overrides |
bsalomon@google.com | 1bf1c21 | 2011-11-05 12:18:58 +0000 | [diff] [blame] | 99 | virtual void onResetContext() SK_OVERRIDE; |
bsalomon@google.com | a7f84e1 | 2011-03-10 14:13:19 +0000 | [diff] [blame] | 100 | |
bsalomon@google.com | fea37b5 | 2011-04-25 15:51:06 +0000 | [diff] [blame] | 101 | virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, |
bsalomon@google.com | bcdbbe6 | 2011-04-12 15:40:00 +0000 | [diff] [blame] | 102 | const void* srcData, |
| 103 | size_t rowBytes); |
| 104 | virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size, |
| 105 | bool dynamic); |
| 106 | virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size, |
| 107 | bool dynamic); |
bsalomon@google.com | e269f21 | 2011-11-07 13:29:52 +0000 | [diff] [blame] | 108 | virtual GrTexture* onCreatePlatformTexture(const GrPlatformTextureDesc& desc) SK_OVERRIDE; |
| 109 | virtual GrRenderTarget* onCreatePlatformRenderTarget(const GrPlatformRenderTargetDesc& desc) SK_OVERRIDE; |
bsalomon@google.com | 81c3f8d | 2011-08-03 15:18:33 +0000 | [diff] [blame] | 110 | virtual bool createStencilBufferForRenderTarget(GrRenderTarget* rt, |
| 111 | int width, int height); |
| 112 | virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer* sb, |
| 113 | GrRenderTarget* rt); |
bsalomon@google.com | a7f84e1 | 2011-03-10 14:13:19 +0000 | [diff] [blame] | 114 | |
bsalomon@google.com | 6aa25c3 | 2011-04-27 19:55:29 +0000 | [diff] [blame] | 115 | virtual void onClear(const GrIRect* rect, GrColor color); |
bsalomon@google.com | a7f84e1 | 2011-03-10 14:13:19 +0000 | [diff] [blame] | 116 | |
bsalomon@google.com | bcdbbe6 | 2011-04-12 15:40:00 +0000 | [diff] [blame] | 117 | virtual void onForceRenderTargetFlush(); |
bsalomon@google.com | a7f84e1 | 2011-03-10 14:13:19 +0000 | [diff] [blame] | 118 | |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 119 | virtual bool onReadPixels(GrRenderTarget* target, |
bsalomon@google.com | c698097 | 2011-11-02 19:57:21 +0000 | [diff] [blame] | 120 | int left, int top, |
| 121 | int width, int height, |
| 122 | GrPixelConfig, |
bsalomon@google.com | c436499 | 2011-11-07 15:54:49 +0000 | [diff] [blame] | 123 | void* buffer, |
| 124 | size_t rowBytes, |
| 125 | bool invertY) SK_OVERRIDE; |
bsalomon@google.com | a7f84e1 | 2011-03-10 14:13:19 +0000 | [diff] [blame] | 126 | |
bsalomon@google.com | 6f37951 | 2011-11-16 20:36:03 +0000 | [diff] [blame] | 127 | virtual void onWriteTexturePixels(GrTexture* texture, |
| 128 | int left, int top, int width, int height, |
| 129 | GrPixelConfig config, const void* buffer, |
| 130 | size_t rowBytes) SK_OVERRIDE; |
| 131 | |
bsalomon@google.com | 75f9f25 | 2012-01-31 13:35:56 +0000 | [diff] [blame] | 132 | virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; |
| 133 | |
| 134 | |
bsalomon@google.com | 25fb21f | 2011-06-21 18:17:25 +0000 | [diff] [blame] | 135 | virtual void onGpuDrawIndexed(GrPrimitiveType type, |
| 136 | uint32_t startVertex, |
| 137 | uint32_t startIndex, |
| 138 | uint32_t vertexCount, |
| 139 | uint32_t indexCount); |
| 140 | virtual void onGpuDrawNonIndexed(GrPrimitiveType type, |
| 141 | uint32_t vertexCount, |
| 142 | uint32_t numVertices); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 143 | virtual void flushScissor(const GrIRect* rect); |
bsalomon@google.com | edc177d | 2011-08-05 15:46:40 +0000 | [diff] [blame] | 144 | virtual void clearStencil(); |
bsalomon@google.com | ab3dee5 | 2011-08-29 15:18:41 +0000 | [diff] [blame] | 145 | virtual void clearStencilClip(const GrIRect& rect, bool insideClip); |
senorblanco@chromium.org | ef3913b | 2011-05-19 17:11:07 +0000 | [diff] [blame] | 146 | virtual int getMaxEdges() const; |
bsalomon@google.com | 5782d71 | 2011-01-21 21:03:59 +0000 | [diff] [blame] | 147 | |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 148 | // binds texture unit in GL |
bsalomon@google.com | 8531c1c | 2011-01-13 19:52:45 +0000 | [diff] [blame] | 149 | void setTextureUnit(int unitIdx); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 150 | |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 151 | // binds appropriate vertex and index buffers, also returns any extra |
| 152 | // extra verts or indices to offset by. |
| 153 | void setBuffers(bool indexed, |
| 154 | int* extraVertexOffset, |
| 155 | int* extraIndexOffset); |
bsalomon@google.com | 7acdb8e | 2011-02-11 14:07:02 +0000 | [diff] [blame] | 156 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 157 | // flushes state that is common to fixed and programmable GL |
| 158 | // dither |
| 159 | // line smoothing |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 160 | // texture binding |
| 161 | // sampler state (filtering, tiling) |
| 162 | // FBO binding |
| 163 | // line width |
bsalomon@google.com | ffca400 | 2011-02-22 20:34:01 +0000 | [diff] [blame] | 164 | bool flushGLStateCommon(GrPrimitiveType type); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 165 | |
bsalomon@google.com | 86c1f71 | 2011-10-12 14:54:26 +0000 | [diff] [blame] | 166 | // Subclasses should call this to flush the blend state. |
| 167 | // The params should be the final coeffecients to apply |
| 168 | // (after any blending optimizations or dual source blending considerations |
| 169 | // have been accounted for). |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 170 | void flushBlend(GrPrimitiveType type, |
| 171 | GrBlendCoeff srcCoeff, |
| 172 | GrBlendCoeff dstCoeff); |
| 173 | |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 174 | bool hasExtension(const char* ext) const { |
| 175 | return fGLContextInfo.hasExtension(ext); |
bsalomon@google.com | 9639994 | 2012-02-13 14:39:16 +0000 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | const GrGLContextInfo& glContextInfo() const { return fGLContextInfo; } |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 179 | |
bsalomon@google.com | 9962108 | 2011-11-15 16:47:16 +0000 | [diff] [blame] | 180 | // adjusts texture matrix to account for orientation |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 181 | static void AdjustTextureMatrix(const GrGLTexture* texture, |
| 182 | GrSamplerState::SampleMode mode, |
| 183 | GrMatrix* matrix); |
bsalomon@google.com | 88939ae | 2011-12-14 15:58:11 +0000 | [diff] [blame] | 184 | |
| 185 | // subclass may try to take advantage of identity tex matrices. |
| 186 | // This helper determines if matrix will be identity after all |
| 187 | // adjustments are applied. |
| 188 | static bool TextureMatrixIsIdentity(const GrGLTexture* texture, |
| 189 | const GrSamplerState& sampler); |
| 190 | |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 191 | static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 192 | |
bsalomon@google.com | 8531c1c | 2011-01-13 19:52:45 +0000 | [diff] [blame] | 193 | private: |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 194 | // Inits GrDrawTarget::Caps, sublcass may enable additional caps. |
bsalomon@google.com | 18c9c19 | 2011-09-22 21:01:31 +0000 | [diff] [blame] | 195 | void initCaps(); |
| 196 | |
| 197 | void initFSAASupport(); |
bsalomon@google.com | 6aa25c3 | 2011-04-27 19:55:29 +0000 | [diff] [blame] | 198 | |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 199 | // determines valid stencil formats |
bsalomon@google.com | 18c9c19 | 2011-09-22 21:01:31 +0000 | [diff] [blame] | 200 | void initStencilFormats(); |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 201 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 202 | // notify callbacks to update state tracking when related |
| 203 | // objects are bound to GL or deleted outside of the class |
| 204 | void notifyVertexBufferBind(const GrGLVertexBuffer* buffer); |
| 205 | void notifyVertexBufferDelete(const GrGLVertexBuffer* buffer); |
| 206 | void notifyIndexBufferBind(const GrGLIndexBuffer* buffer); |
| 207 | void notifyIndexBufferDelete(const GrGLIndexBuffer* buffer); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 208 | void notifyTextureDelete(GrGLTexture* texture); |
| 209 | void notifyRenderTargetDelete(GrRenderTarget* renderTarget); |
bsalomon@google.com | 5782d71 | 2011-01-21 21:03:59 +0000 | [diff] [blame] | 210 | |
bsalomon@google.com | 8531c1c | 2011-01-13 19:52:45 +0000 | [diff] [blame] | 211 | void setSpareTextureUnit(); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 212 | |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 213 | // bound is region that may be modified and therefore has to be resolved. |
| 214 | // NULL means whole target. Can be an empty rect. |
| 215 | void flushRenderTarget(const GrIRect* bound); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 216 | void flushStencil(); |
bsalomon@google.com | f954d8d | 2011-04-06 17:50:02 +0000 | [diff] [blame] | 217 | void flushAAState(GrPrimitiveType type); |
bsalomon@google.com | 0650e81 | 2011-04-08 18:07:53 +0000 | [diff] [blame] | 218 | |
bsalomon@google.com | 280e99f | 2012-01-05 16:17:38 +0000 | [diff] [blame] | 219 | bool configToGLFormats(GrPixelConfig config, |
| 220 | bool getSizedInternal, |
| 221 | GrGLenum* internalFormat, |
| 222 | GrGLenum* externalFormat, |
| 223 | GrGLenum* externalType); |
bsalomon@google.com | 6f37951 | 2011-11-16 20:36:03 +0000 | [diff] [blame] | 224 | // helper for onCreateTexture and writeTexturePixels |
bsalomon@google.com | 136f55b | 2011-11-28 18:34:44 +0000 | [diff] [blame] | 225 | bool uploadTexData(const GrGLTexture::Desc& desc, |
bsalomon@google.com | 1e0e607 | 2011-11-28 18:49:37 +0000 | [diff] [blame] | 226 | bool isNewTexture, |
bsalomon@google.com | 6f37951 | 2011-11-16 20:36:03 +0000 | [diff] [blame] | 227 | int left, int top, int width, int height, |
| 228 | GrPixelConfig dataConfig, |
| 229 | const void* data, |
| 230 | size_t rowBytes); |
bsalomon@google.com | 0650e81 | 2011-04-08 18:07:53 +0000 | [diff] [blame] | 231 | |
bsalomon@google.com | 81c3f8d | 2011-08-03 15:18:33 +0000 | [diff] [blame] | 232 | bool createRenderTargetObjects(int width, int height, |
| 233 | GrGLuint texID, |
| 234 | GrGLRenderTarget::Desc* desc); |
| 235 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 236 | friend class GrGLVertexBuffer; |
| 237 | friend class GrGLIndexBuffer; |
| 238 | friend class GrGLTexture; |
| 239 | friend class GrGLRenderTarget; |
| 240 | |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 241 | GrGLContextInfo fGLContextInfo; |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 242 | |
bsalomon@google.com | 81c3f8d | 2011-08-03 15:18:33 +0000 | [diff] [blame] | 243 | // we want to clear stencil buffers when they are created. We want to clear |
| 244 | // the entire buffer even if it is larger than the color attachment. We |
| 245 | // attach it to this fbo with no color attachment to do the initial clear. |
| 246 | GrGLuint fStencilClearFBO; |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 247 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 248 | bool fHWBlendDisabled; |
| 249 | |
bsalomon@google.com | 8531c1c | 2011-01-13 19:52:45 +0000 | [diff] [blame] | 250 | int fActiveTextureUnitIdx; |
bsalomon@google.com | 5782d71 | 2011-01-21 21:03:59 +0000 | [diff] [blame] | 251 | |
bsalomon@google.com | fe67652 | 2011-06-17 18:12:21 +0000 | [diff] [blame] | 252 | // we record what stencil format worked last time to hopefully exit early |
| 253 | // from our loop that tries stencil formats and calls check fb status. |
| 254 | int fLastSuccessfulStencilFmtIdx; |
| 255 | |
bsalomon@google.com | a91e923 | 2012-02-23 15:39:54 +0000 | [diff] [blame^] | 256 | enum CanPreserveUnpremulRoundtrip { |
| 257 | kUnknown_CanPreserveUnpremulRoundtrip, |
| 258 | kNo_CanPreserveUnpremulRoundtrip, |
| 259 | kYes_CanPreserveUnpremulRoundtrip, |
| 260 | } fCanPreserveUnpremulRoundtrip; |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 261 | |
bsalomon@google.com | 18c9c19 | 2011-09-22 21:01:31 +0000 | [diff] [blame] | 262 | bool fPrintedCaps; |
| 263 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 264 | typedef GrGpu INHERITED; |
| 265 | }; |
| 266 | |
bsalomon@google.com | a7f84e1 | 2011-03-10 14:13:19 +0000 | [diff] [blame] | 267 | #endif |
bsalomon@google.com | fe67652 | 2011-06-17 18:12:21 +0000 | [diff] [blame] | 268 | |