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 GrGpuGL_DEFINED | 8 #ifndef GrGpuGL_DEFINED |
9 #define GrGpuGL_DEFINED | 9 #define GrGpuGL_DEFINED |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 size_t rowBytes) SK_OVERRIDE; | 139 size_t rowBytes) SK_OVERRIDE; |
140 | 140 |
141 bool onWriteTexturePixels(GrTexture* texture, | 141 bool onWriteTexturePixels(GrTexture* texture, |
142 int left, int top, int width, int height, | 142 int left, int top, int width, int height, |
143 GrPixelConfig config, const void* buffer, | 143 GrPixelConfig config, const void* buffer, |
144 size_t rowBytes) SK_OVERRIDE; | 144 size_t rowBytes) SK_OVERRIDE; |
145 | 145 |
146 void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; | 146 void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; |
147 | 147 |
148 void onDraw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&) SK_OVERRID
E; | 148 void onDraw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&) SK_OVERRID
E; |
149 void onStencilPath(const GrOptDrawState&, const GrPath*, const GrStencilSett
ings&) SK_OVERRIDE; | 149 void onStencilPath(const GrPath*, const StencilPathState&) SK_OVERRIDE; |
150 void onDrawPath(const GrOptDrawState&, const GrPath*, const GrStencilSetting
s&) SK_OVERRIDE; | 150 void onDrawPath(const GrOptDrawState&, const GrPath*, const GrStencilSetting
s&) SK_OVERRIDE; |
151 void onDrawPaths(const GrOptDrawState&, | 151 void onDrawPaths(const GrOptDrawState&, |
152 const GrPathRange*, | 152 const GrPathRange*, |
153 const void* indices, | 153 const void* indices, |
154 GrDrawTarget::PathIndexType, | 154 GrDrawTarget::PathIndexType, |
155 const float transformValues[], | 155 const float transformValues[], |
156 GrDrawTarget::PathTransformType, | 156 GrDrawTarget::PathTransformType, |
157 int count, | 157 int count, |
158 const GrStencilSettings&) SK_OVERRIDE; | 158 const GrStencilSettings&) SK_OVERRIDE; |
159 | 159 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 int fCount; | 216 int fCount; |
217 unsigned int fCurrLRUStamp; | 217 unsigned int fCurrLRUStamp; |
218 GrGLGpu* fGpu; | 218 GrGLGpu* fGpu; |
219 #ifdef PROGRAM_CACHE_STATS | 219 #ifdef PROGRAM_CACHE_STATS |
220 int fTotalRequests; | 220 int fTotalRequests; |
221 int fCacheMisses; | 221 int fCacheMisses; |
222 int fHashMisses; // cache hit but hash table mis
sed | 222 int fHashMisses; // cache hit but hash table mis
sed |
223 #endif | 223 #endif |
224 }; | 224 }; |
225 | 225 |
226 // flushes dithering, color-mask, and face culling stat | 226 void flushDither(bool dither); |
227 void flushMiscFixedFunctionState(const GrOptDrawState&); | 227 void flushColorWriteDisable(bool disableColorWrites); |
| 228 void flushDrawFace(GrDrawState::DrawFace face); |
228 | 229 |
229 // flushes the scissor. see the note on flushBoundTextureAndParams about | 230 // flushes the scissor. see the note on flushBoundTextureAndParams about |
230 // flushing the scissor after that function is called. | 231 // flushing the scissor after that function is called. |
231 void flushScissor(const GrClipMaskManager::ScissorState&, | 232 void flushScissor(const GrScissorState&, |
232 const GrGLIRect& rtViewport, | 233 const GrGLIRect& rtViewport, |
233 GrSurfaceOrigin rtOrigin); | 234 GrSurfaceOrigin rtOrigin); |
234 | 235 |
235 // disables the scissor | 236 // disables the scissor |
236 void disableScissor(); | 237 void disableScissor(); |
237 | 238 |
238 void initFSAASupport(); | 239 void initFSAASupport(); |
239 | 240 |
240 // determines valid stencil formats | 241 // determines valid stencil formats |
241 void initStencilFormats(); | 242 void initStencilFormats(); |
242 | 243 |
243 // sets a texture unit to use for texture operations other than binding a te
xture to a program. | 244 // sets a texture unit to use for texture operations other than binding a te
xture to a program. |
244 // ensures that such operations don't negatively interact with tracking boun
d textures. | 245 // ensures that such operations don't negatively interact with tracking boun
d textures. |
245 void setScratchTextureUnit(); | 246 void setScratchTextureUnit(); |
246 | 247 |
247 // bounds is region that may be modified and therefore has to be resolved. | 248 // bounds is region that may be modified and therefore has to be resolved. |
248 // NULL means whole target. Can be an empty rect. | 249 // NULL means whole target. Can be an empty rect. |
249 void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); | 250 void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); |
250 | 251 |
251 void flushStencil(const GrStencilSettings&, DrawType); | 252 void flushStencil(const GrStencilSettings&); |
252 void flushAAState(const GrOptDrawState&); | 253 void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool isLineDraw); |
253 | 254 |
254 bool configToGLFormats(GrPixelConfig config, | 255 bool configToGLFormats(GrPixelConfig config, |
255 bool getSizedInternal, | 256 bool getSizedInternal, |
256 GrGLenum* internalFormat, | 257 GrGLenum* internalFormat, |
257 GrGLenum* externalFormat, | 258 GrGLenum* externalFormat, |
258 GrGLenum* externalType); | 259 GrGLenum* externalType); |
259 // helper for onCreateTexture and writeTexturePixels | 260 // helper for onCreateTexture and writeTexturePixels |
260 bool uploadTexData(const GrSurfaceDesc& desc, | 261 bool uploadTexData(const GrSurfaceDesc& desc, |
261 bool isNewTexture, | 262 bool isNewTexture, |
262 int left, int top, int width, int height, | 263 int left, int top, int width, int height, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 450 |
450 // we record what stencil format worked last time to hopefully exit early | 451 // we record what stencil format worked last time to hopefully exit early |
451 // from our loop that tries stencil formats and calls check fb status. | 452 // from our loop that tries stencil formats and calls check fb status. |
452 int fLastSuccessfulStencilFmtIdx; | 453 int fLastSuccessfulStencilFmtIdx; |
453 | 454 |
454 typedef GrGpu INHERITED; | 455 typedef GrGpu INHERITED; |
455 friend class GrGLPathRendering; // For accessing setTextureUnit. | 456 friend class GrGLPathRendering; // For accessing setTextureUnit. |
456 }; | 457 }; |
457 | 458 |
458 #endif | 459 #endif |
OLD | NEW |