| OLD | NEW |
| 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 GrGLGpu_DEFINED | 8 #ifndef GrGLGpu_DEFINED |
| 9 #define GrGLGpu_DEFINED | 9 #define GrGLGpu_DEFINED |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 void clearStencil(GrRenderTarget*) SK_OVERRIDE; | 159 void clearStencil(GrRenderTarget*) SK_OVERRIDE; |
| 160 | 160 |
| 161 // GrDrawTarget overrides | 161 // GrDrawTarget overrides |
| 162 void didAddGpuTraceMarker() SK_OVERRIDE; | 162 void didAddGpuTraceMarker() SK_OVERRIDE; |
| 163 void didRemoveGpuTraceMarker() SK_OVERRIDE; | 163 void didRemoveGpuTraceMarker() SK_OVERRIDE; |
| 164 | 164 |
| 165 // binds texture unit in GL | 165 // binds texture unit in GL |
| 166 void setTextureUnit(int unitIdx); | 166 void setTextureUnit(int unitIdx); |
| 167 | 167 |
| 168 // Flushes state from GrPipeline to GL. Returns false if the state couldn't
be set. | 168 // Flushes state from GrPipeline to GL. Returns false if the state couldn't
be set. |
| 169 // TODO we only have need to know if this is a line draw for flushing AA sta
te on some buggy | 169 bool flushGLState(const DrawArgs&); |
| 170 // hardware. Evaluate if this is really necessary anymore | |
| 171 bool flushGLState(const DrawArgs&, bool isLineDraw); | |
| 172 | 170 |
| 173 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt
es gives the offset | 171 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt
es gives the offset |
| 174 // an into the index buffer. It does not account for drawInfo.startIndex() b
ut rather the start | 172 // an into the index buffer. It does not account for drawInfo.startIndex() b
ut rather the start |
| 175 // index is relative to the returned offset. | 173 // index is relative to the returned offset. |
| 176 void setupGeometry(const GrPrimitiveProcessor&, | 174 void setupGeometry(const GrPrimitiveProcessor&, |
| 177 const GrDrawTarget::DrawInfo& info, | 175 const GrDrawTarget::DrawInfo& info, |
| 178 size_t* indexOffsetInBytes); | 176 size_t* indexOffsetInBytes); |
| 179 | 177 |
| 180 // Subclasses should call this to flush the blend state. | 178 // Subclasses should call this to flush the blend state. |
| 181 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo); | 179 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 242 |
| 245 // sets a texture unit to use for texture operations other than binding a te
xture to a program. | 243 // sets a texture unit to use for texture operations other than binding a te
xture to a program. |
| 246 // ensures that such operations don't negatively interact with tracking boun
d textures. | 244 // ensures that such operations don't negatively interact with tracking boun
d textures. |
| 247 void setScratchTextureUnit(); | 245 void setScratchTextureUnit(); |
| 248 | 246 |
| 249 // bounds is region that may be modified and therefore has to be resolved. | 247 // bounds is region that may be modified and therefore has to be resolved. |
| 250 // NULL means whole target. Can be an empty rect. | 248 // NULL means whole target. Can be an empty rect. |
| 251 void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); | 249 void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); |
| 252 | 250 |
| 253 void flushStencil(const GrStencilSettings&); | 251 void flushStencil(const GrStencilSettings&); |
| 254 void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool isLineDraw); | 252 void flushHWAAState(GrRenderTarget* rt, bool useHWAA); |
| 255 | 253 |
| 256 bool configToGLFormats(GrPixelConfig config, | 254 bool configToGLFormats(GrPixelConfig config, |
| 257 bool getSizedInternal, | 255 bool getSizedInternal, |
| 258 GrGLenum* internalFormat, | 256 GrGLenum* internalFormat, |
| 259 GrGLenum* externalFormat, | 257 GrGLenum* externalFormat, |
| 260 GrGLenum* externalType); | 258 GrGLenum* externalType); |
| 261 // helper for onCreateTexture and writeTexturePixels | 259 // helper for onCreateTexture and writeTexturePixels |
| 262 bool uploadTexData(const GrSurfaceDesc& desc, | 260 bool uploadTexData(const GrSurfaceDesc& desc, |
| 263 bool isNewTexture, | 261 bool isNewTexture, |
| 264 int left, int top, int width, int height, | 262 int left, int top, int width, int height, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 463 |
| 466 // we record what stencil format worked last time to hopefully exit early | 464 // we record what stencil format worked last time to hopefully exit early |
| 467 // from our loop that tries stencil formats and calls check fb status. | 465 // from our loop that tries stencil formats and calls check fb status. |
| 468 int fLastSuccessfulStencilFmtIdx; | 466 int fLastSuccessfulStencilFmtIdx; |
| 469 | 467 |
| 470 typedef GrGpu INHERITED; | 468 typedef GrGpu INHERITED; |
| 471 friend class GrGLPathRendering; // For accessing setTextureUnit. | 469 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 472 }; | 470 }; |
| 473 | 471 |
| 474 #endif | 472 #endif |
| OLD | NEW |