| 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 13 matching lines...) Expand all Loading... |
| 24 #define PROGRAM_CACHE_STATS | 24 #define PROGRAM_CACHE_STATS |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 class GrGLPathRendering; | 27 class GrGLPathRendering; |
| 28 | 28 |
| 29 class GrGpuGL : public GrGpu { | 29 class GrGpuGL : public GrGpu { |
| 30 public: | 30 public: |
| 31 GrGpuGL(const GrGLContext& ctx, GrContext* context); | 31 GrGpuGL(const GrGLContext& ctx, GrContext* context); |
| 32 virtual ~GrGpuGL(); | 32 virtual ~GrGpuGL(); |
| 33 | 33 |
| 34 virtual void contextAbandonded() SK_OVERRIDE; | |
| 35 | |
| 36 const GrGLContext& glContext() const { return fGLContext; } | 34 const GrGLContext& glContext() const { return fGLContext; } |
| 37 | 35 |
| 38 const GrGLInterface* glInterface() const { return fGLContext.interface(); } | 36 const GrGLInterface* glInterface() const { return fGLContext.interface(); } |
| 39 const GrGLContextInfo& ctxInfo() const { return fGLContext; } | 37 const GrGLContextInfo& ctxInfo() const { return fGLContext; } |
| 40 GrGLStandard glStandard() const { return fGLContext.standard(); } | 38 GrGLStandard glStandard() const { return fGLContext.standard(); } |
| 41 GrGLVersion glVersion() const { return fGLContext.version(); } | 39 GrGLVersion glVersion() const { return fGLContext.version(); } |
| 42 GrGLSLGeneration glslGeneration() const { return fGLContext.glslGeneration()
; } | 40 GrGLSLGeneration glslGeneration() const { return fGLContext.glslGeneration()
; } |
| 43 const GrGLCaps& glCaps() const { return *fGLContext.caps(); } | 41 const GrGLCaps& glCaps() const { return *fGLContext.caps(); } |
| 44 | 42 |
| 45 GrGLPathRendering* pathRendering() const { | 43 GrGLPathRendering* pathRendering() const { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual bool readPixelsWillPayForYFlip( | 76 virtual bool readPixelsWillPayForYFlip( |
| 79 GrRenderTarget* renderTarget, | 77 GrRenderTarget* renderTarget, |
| 80 int left, int top, | 78 int left, int top, |
| 81 int width, int height, | 79 int width, int height, |
| 82 GrPixelConfig config, | 80 GrPixelConfig config, |
| 83 size_t rowBytes) const SK_OVERRIDE; | 81 size_t rowBytes) const SK_OVERRIDE; |
| 84 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; | 82 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; |
| 85 | 83 |
| 86 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; | 84 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; |
| 87 | 85 |
| 86 virtual void abandonResources() SK_OVERRIDE; |
| 87 |
| 88 // These functions should be used to bind GL objects. They track the GL stat
e and skip redundant | 88 // These functions should be used to bind GL objects. They track the GL stat
e and skip redundant |
| 89 // bindings. Making the equivalent glBind calls directly will confuse the st
ate tracking. | 89 // bindings. Making the equivalent glBind calls directly will confuse the st
ate tracking. |
| 90 void bindVertexArray(GrGLuint id) { | 90 void bindVertexArray(GrGLuint id) { |
| 91 fHWGeometryState.setVertexArrayID(this, id); | 91 fHWGeometryState.setVertexArrayID(this, id); |
| 92 } | 92 } |
| 93 void bindIndexBufferAndDefaultVertexArray(GrGLuint id) { | 93 void bindIndexBufferAndDefaultVertexArray(GrGLuint id) { |
| 94 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, id); | 94 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, id); |
| 95 } | 95 } |
| 96 void bindVertexBuffer(GrGLuint id) { | 96 void bindVertexBuffer(GrGLuint id) { |
| 97 fHWGeometryState.setVertexBufferID(this, id); | 97 fHWGeometryState.setVertexBufferID(this, id); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 // we record what stencil format worked last time to hopefully exit early | 469 // we record what stencil format worked last time to hopefully exit early |
| 470 // from our loop that tries stencil formats and calls check fb status. | 470 // from our loop that tries stencil formats and calls check fb status. |
| 471 int fLastSuccessfulStencilFmtIdx; | 471 int fLastSuccessfulStencilFmtIdx; |
| 472 | 472 |
| 473 SkAutoTDelete<GrGLPathRendering> fPathRendering; | 473 SkAutoTDelete<GrGLPathRendering> fPathRendering; |
| 474 | 474 |
| 475 typedef GrGpu INHERITED; | 475 typedef GrGpu INHERITED; |
| 476 }; | 476 }; |
| 477 | 477 |
| 478 #endif | 478 #endif |
| OLD | NEW |