Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 public: | 29 public: |
| 30 GrGpuGL(const GrGLContext& ctx, GrContext* context); | 30 GrGpuGL(const GrGLContext& ctx, GrContext* context); |
| 31 virtual ~GrGpuGL(); | 31 virtual ~GrGpuGL(); |
| 32 | 32 |
| 33 const GrGLInterface* glInterface() const { return fGLContext.interface(); } | 33 const GrGLInterface* glInterface() const { return fGLContext.interface(); } |
| 34 const GrGLContextInfo& ctxInfo() const { return fGLContext.info(); } | 34 const GrGLContextInfo& ctxInfo() const { return fGLContext.info(); } |
| 35 GrGLBinding glBinding() const { return fGLContext.info().binding(); } | 35 GrGLBinding glBinding() const { return fGLContext.info().binding(); } |
| 36 GrGLVersion glVersion() const { return fGLContext.info().version(); } | 36 GrGLVersion glVersion() const { return fGLContext.info().version(); } |
| 37 GrGLSLGeneration glslGeneration() const { return fGLContext.info().glslGener ation(); } | 37 GrGLSLGeneration glslGeneration() const { return fGLContext.info().glslGener ation(); } |
| 38 | 38 |
| 39 // Used by GrGLProgram to bind necessary textures for GrGLEffects. | 39 // Used by GrGLProgram and GrGLUniformManager to configure OpenGL state. |
| 40 void bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* te xture); | 40 void bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* te xture); |
| 41 void setProjectionMatrix(const SkMatrix& matrix, | |
| 42 const SkISize& renderTargetSize, | |
| 43 GrSurfaceOrigin renderTargetOrigin); | |
| 44 void enableTexGen(int unitIdx, int numComponents, const GrGLfloat* coefficie nts); | |
| 45 void enableTexGen(int unitIdx, int numComponents, const SkMatrix& matrix); | |
| 46 void disableUnusedTexGenUnits(int numUsedUnits); | |
| 41 | 47 |
| 42 bool programUnitTest(int maxStages); | 48 bool programUnitTest(int maxStages); |
| 43 | 49 |
| 44 // GrGpu overrides | 50 // GrGpu overrides |
| 45 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig, | 51 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig, |
| 46 GrPixelConfig surfaceConfig) const SK_OVERRIDE; | 52 GrPixelConfig surfaceConfig) const SK_OVERRIDE; |
| 47 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig, | 53 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig, |
| 48 GrPixelConfig surfaceConfig ) const SK_OVERRIDE; | 54 GrPixelConfig surfaceConfig ) const SK_OVERRIDE; |
| 49 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig ) const SK_OVERRIDE; | 55 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig ) const SK_OVERRIDE; |
| 50 virtual bool readPixelsWillPayForYFlip( | 56 virtual bool readPixelsWillPayForYFlip( |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 int fCount; | 211 int fCount; |
| 206 unsigned int fCurrLRUStamp; | 212 unsigned int fCurrLRUStamp; |
| 207 GrGpuGL* fGpu; | 213 GrGpuGL* fGpu; |
| 208 #ifdef PROGRAM_CACHE_STATS | 214 #ifdef PROGRAM_CACHE_STATS |
| 209 int fTotalRequests; | 215 int fTotalRequests; |
| 210 int fCacheMisses; | 216 int fCacheMisses; |
| 211 int fHashMisses; // cache hit but hash table mis sed | 217 int fHashMisses; // cache hit but hash table mis sed |
| 212 #endif | 218 #endif |
| 213 }; | 219 }; |
| 214 | 220 |
| 215 // sets the matrix for path stenciling (uses the GL fixed pipe matrices) | |
| 216 void flushPathStencilMatrix(); | |
| 217 | |
| 218 // flushes dithering, color-mask, and face culling stat | 221 // flushes dithering, color-mask, and face culling stat |
| 219 void flushMiscFixedFunctionState(); | 222 void flushMiscFixedFunctionState(); |
| 220 | 223 |
| 221 // flushes the scissor. see the note on flushBoundTextureAndParams about | 224 // flushes the scissor. see the note on flushBoundTextureAndParams about |
| 222 // flushing the scissor after that function is called. | 225 // flushing the scissor after that function is called. |
| 223 void flushScissor(); | 226 void flushScissor(); |
| 224 | 227 |
| 225 void initFSAASupport(); | 228 void initFSAASupport(); |
| 226 | 229 |
| 227 // determines valid stencil formats | 230 // determines valid stencil formats |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 GrGLProgram::MatrixState fHWProjectionMatrixState; | 427 GrGLProgram::MatrixState fHWProjectionMatrixState; |
| 425 | 428 |
| 426 GrStencilSettings fHWStencilSettings; | 429 GrStencilSettings fHWStencilSettings; |
| 427 TriState fHWStencilTestEnabled; | 430 TriState fHWStencilTestEnabled; |
| 428 | 431 |
| 429 GrDrawState::DrawFace fHWDrawFace; | 432 GrDrawState::DrawFace fHWDrawFace; |
| 430 TriState fHWWriteToColor; | 433 TriState fHWWriteToColor; |
| 431 TriState fHWDitherEnabled; | 434 TriState fHWDitherEnabled; |
| 432 GrRenderTarget* fHWBoundRenderTarget; | 435 GrRenderTarget* fHWBoundRenderTarget; |
| 433 SkTArray<GrTexture*, true> fHWBoundTextures; | 436 SkTArray<GrTexture*, true> fHWBoundTextures; |
| 437 | |
| 438 struct TexGenData { | |
| 439 GrGLenum fMode; | |
| 440 GrGLint fNumComponents; | |
| 441 GrGLfloat fCoefficients[6]; | |
|
Kimmo Kinnunen
2013/09/17 09:42:40
I think this should be 9 floats long.
| |
| 442 }; | |
| 443 int fHWActiveTexGenUnits; | |
| 444 SkTArray<TexGenData, true> fHWTexGenSettings; | |
| 434 ///@} | 445 ///@} |
| 435 | 446 |
| 436 // we record what stencil format worked last time to hopefully exit early | 447 // we record what stencil format worked last time to hopefully exit early |
| 437 // from our loop that tries stencil formats and calls check fb status. | 448 // from our loop that tries stencil formats and calls check fb status. |
| 438 int fLastSuccessfulStencilFmtIdx; | 449 int fLastSuccessfulStencilFmtIdx; |
| 439 | 450 |
| 440 typedef GrGpu INHERITED; | 451 typedef GrGpu INHERITED; |
| 441 }; | 452 }; |
| 442 | 453 |
| 443 #endif | 454 #endif |
| OLD | NEW |