| 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 10 matching lines...) Expand all Loading... |
| 21 #include "GrTypes.h" | 21 #include "GrTypes.h" |
| 22 #include "GrXferProcessor.h" | 22 #include "GrXferProcessor.h" |
| 23 #include "SkTArray.h" | 23 #include "SkTArray.h" |
| 24 #include "SkTypes.h" | 24 #include "SkTypes.h" |
| 25 | 25 |
| 26 class GrGLBuffer; | 26 class GrGLBuffer; |
| 27 class GrPipeline; | 27 class GrPipeline; |
| 28 class GrNonInstancedMesh; | 28 class GrNonInstancedMesh; |
| 29 class GrSwizzle; | 29 class GrSwizzle; |
| 30 | 30 |
| 31 namespace gr_instanced { class GLInstancedRendering; } |
| 32 |
| 31 #ifdef SK_DEBUG | 33 #ifdef SK_DEBUG |
| 32 #define PROGRAM_CACHE_STATS | 34 #define PROGRAM_CACHE_STATS |
| 33 #endif | 35 #endif |
| 34 | 36 |
| 35 class GrGLGpu final : public GrGpu { | 37 class GrGLGpu final : public GrGpu { |
| 36 public: | 38 public: |
| 37 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions
& options, | 39 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions
& options, |
| 38 GrContext* context); | 40 GrContext* context); |
| 39 ~GrGLGpu() override; | 41 ~GrGLGpu() override; |
| 40 | 42 |
| 41 void disconnect(DisconnectType) override; | 43 void disconnect(DisconnectType) override; |
| 42 | 44 |
| 43 const GrGLContext& glContext() const { return *fGLContext; } | 45 const GrGLContext& glContext() const { return *fGLContext; } |
| 44 | 46 |
| 45 const GrGLInterface* glInterface() const { return fGLContext->interface(); } | 47 const GrGLInterface* glInterface() const { return fGLContext->interface(); } |
| 46 const GrGLContextInfo& ctxInfo() const { return *fGLContext; } | 48 const GrGLContextInfo& ctxInfo() const { return *fGLContext; } |
| 47 GrGLStandard glStandard() const { return fGLContext->standard(); } | 49 GrGLStandard glStandard() const { return fGLContext->standard(); } |
| 48 GrGLVersion glVersion() const { return fGLContext->version(); } | 50 GrGLVersion glVersion() const { return fGLContext->version(); } |
| 49 GrGLSLGeneration glslGeneration() const { return fGLContext->glslGeneration(
); } | 51 GrGLSLGeneration glslGeneration() const { return fGLContext->glslGeneration(
); } |
| 50 const GrGLCaps& glCaps() const { return *fGLContext->caps(); } | 52 const GrGLCaps& glCaps() const { return *fGLContext->caps(); } |
| 51 | 53 |
| 52 GrGLPathRendering* glPathRendering() { | 54 GrGLPathRendering* glPathRendering() { |
| 53 SkASSERT(glCaps().shaderCaps()->pathRenderingSupport()); | 55 SkASSERT(glCaps().shaderCaps()->pathRenderingSupport()); |
| 54 return static_cast<GrGLPathRendering*>(pathRendering()); | 56 return static_cast<GrGLPathRendering*>(pathRendering()); |
| 55 } | 57 } |
| 56 | 58 |
| 59 gr_instanced::InstancedRendering* createInstancedRenderingIfSupported() over
ride; |
| 60 |
| 57 // Used by GrGLProgram to configure OpenGL state. | 61 // Used by GrGLProgram to configure OpenGL state. |
| 58 void bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBI
nputs, | 62 void bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBI
nputs, |
| 59 GrGLTexture* texture); | 63 GrGLTexture* texture); |
| 60 | 64 |
| 61 void bindTexelBuffer(int unitIdx, GrPixelConfig, GrGLBuffer*); | 65 void bindTexelBuffer(int unitIdx, GrPixelConfig, GrGLBuffer*); |
| 62 | 66 |
| 63 void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, Gr
GLTexture* texture); | 67 void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, Gr
GLTexture* texture); |
| 64 | 68 |
| 65 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, | 69 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, |
| 66 GrPixelConfig readConfig, DrawPreference*, | 70 GrPixelConfig readConfig, DrawPreference*, |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 SkAutoTUnref<GrGLBuffer> fArrayBuffer; | 594 SkAutoTUnref<GrGLBuffer> fArrayBuffer; |
| 591 } fPLSSetupProgram; | 595 } fPLSSetupProgram; |
| 592 | 596 |
| 593 bool fHWPLSEnabled; | 597 bool fHWPLSEnabled; |
| 594 bool fPLSHasBeenUsed; | 598 bool fPLSHasBeenUsed; |
| 595 | 599 |
| 596 float fHWMinSampleShading; | 600 float fHWMinSampleShading; |
| 597 | 601 |
| 598 typedef GrGpu INHERITED; | 602 typedef GrGpu INHERITED; |
| 599 friend class GrGLPathRendering; // For accessing setTextureUnit. | 603 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 604 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta
te. |
| 600 }; | 605 }; |
| 601 | 606 |
| 602 #endif | 607 #endif |
| OLD | NEW |