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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #ifdef SK_DEVELOPER | 24 #ifdef SK_DEVELOPER |
25 #define PROGRAM_CACHE_STATS | 25 #define PROGRAM_CACHE_STATS |
26 #endif | 26 #endif |
27 | 27 |
28 class GrGpuGL : public GrGpu { | 28 class GrGpuGL : public GrGpu { |
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 virtual void contextAbandonded() SK_OVERRIDE; |
| 34 |
33 const GrGLContext& glContext() const { return fGLContext; } | 35 const GrGLContext& glContext() const { return fGLContext; } |
34 | 36 |
35 const GrGLInterface* glInterface() const { return fGLContext.interface(); } | 37 const GrGLInterface* glInterface() const { return fGLContext.interface(); } |
36 const GrGLContextInfo& ctxInfo() const { return fGLContext; } | 38 const GrGLContextInfo& ctxInfo() const { return fGLContext; } |
37 GrGLStandard glStandard() const { return fGLContext.standard(); } | 39 GrGLStandard glStandard() const { return fGLContext.standard(); } |
38 GrGLVersion glVersion() const { return fGLContext.version(); } | 40 GrGLVersion glVersion() const { return fGLContext.version(); } |
39 GrGLSLGeneration glslGeneration() const { return fGLContext.glslGeneration()
; } | 41 GrGLSLGeneration glslGeneration() const { return fGLContext.glslGeneration()
; } |
40 const GrGLCaps& glCaps() const { return *fGLContext.caps(); } | 42 const GrGLCaps& glCaps() const { return *fGLContext.caps(); } |
41 | 43 |
42 GrGLPathRendering* glPathRendering() { | 44 GrGLPathRendering* glPathRendering() { |
(...skipping 25 matching lines...) Expand all Loading... |
68 virtual bool readPixelsWillPayForYFlip( | 70 virtual bool readPixelsWillPayForYFlip( |
69 GrRenderTarget* renderTarget, | 71 GrRenderTarget* renderTarget, |
70 int left, int top, | 72 int left, int top, |
71 int width, int height, | 73 int width, int height, |
72 GrPixelConfig config, | 74 GrPixelConfig config, |
73 size_t rowBytes) const SK_OVERRIDE; | 75 size_t rowBytes) const SK_OVERRIDE; |
74 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; | 76 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; |
75 | 77 |
76 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; | 78 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; |
77 | 79 |
78 virtual void abandonResources() SK_OVERRIDE; | |
79 | |
80 // These functions should be used to bind GL objects. They track the GL stat
e and skip redundant | 80 // These functions should be used to bind GL objects. They track the GL stat
e and skip redundant |
81 // bindings. Making the equivalent glBind calls directly will confuse the st
ate tracking. | 81 // bindings. Making the equivalent glBind calls directly will confuse the st
ate tracking. |
82 void bindVertexArray(GrGLuint id) { | 82 void bindVertexArray(GrGLuint id) { |
83 fHWGeometryState.setVertexArrayID(this, id); | 83 fHWGeometryState.setVertexArrayID(this, id); |
84 } | 84 } |
85 void bindIndexBufferAndDefaultVertexArray(GrGLuint id) { | 85 void bindIndexBufferAndDefaultVertexArray(GrGLuint id) { |
86 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, id); | 86 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, id); |
87 } | 87 } |
88 void bindVertexBuffer(GrGLuint id) { | 88 void bindVertexBuffer(GrGLuint id) { |
89 fHWGeometryState.setVertexBufferID(this, id); | 89 fHWGeometryState.setVertexBufferID(this, id); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 442 |
443 // we record what stencil format worked last time to hopefully exit early | 443 // we record what stencil format worked last time to hopefully exit early |
444 // from our loop that tries stencil formats and calls check fb status. | 444 // from our loop that tries stencil formats and calls check fb status. |
445 int fLastSuccessfulStencilFmtIdx; | 445 int fLastSuccessfulStencilFmtIdx; |
446 | 446 |
447 typedef GrGpu INHERITED; | 447 typedef GrGpu INHERITED; |
448 friend class GrGLPathRendering; // For accessing setTextureUnit. | 448 friend class GrGLPathRendering; // For accessing setTextureUnit. |
449 }; | 449 }; |
450 | 450 |
451 #endif | 451 #endif |
OLD | NEW |