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