| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 GrPixelConfig surfaceConfig
) const SK_OVERRIDE; | 61 GrPixelConfig surfaceConfig
) const SK_OVERRIDE; |
| 62 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig
) const SK_OVERRIDE; | 62 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig
) const SK_OVERRIDE; |
| 63 virtual bool readPixelsWillPayForYFlip( | 63 virtual bool readPixelsWillPayForYFlip( |
| 64 GrRenderTarget* renderTarget, | 64 GrRenderTarget* renderTarget, |
| 65 int left, int top, | 65 int left, int top, |
| 66 int width, int height, | 66 int width, int height, |
| 67 GrPixelConfig config, | 67 GrPixelConfig config, |
| 68 size_t rowBytes) const SK_OVERRIDE; | 68 size_t rowBytes) const SK_OVERRIDE; |
| 69 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; | 69 virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE; |
| 70 | 70 |
| 71 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* des
c) SK_OVERRIDE; | 71 virtual bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* des
c) SK_OVERRIDE; |
| 72 | 72 |
| 73 // These functions should be used to bind GL objects. They track the GL stat
e and skip redundant | 73 // These functions should be used to bind GL objects. They track the GL stat
e and skip redundant |
| 74 // bindings. Making the equivalent glBind calls directly will confuse the st
ate tracking. | 74 // bindings. Making the equivalent glBind calls directly will confuse the st
ate tracking. |
| 75 void bindVertexArray(GrGLuint id) { | 75 void bindVertexArray(GrGLuint id) { |
| 76 fHWGeometryState.setVertexArrayID(this, id); | 76 fHWGeometryState.setVertexArrayID(this, id); |
| 77 } | 77 } |
| 78 void bindIndexBufferAndDefaultVertexArray(GrGLuint id) { | 78 void bindIndexBufferAndDefaultVertexArray(GrGLuint id) { |
| 79 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, id); | 79 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, id); |
| 80 } | 80 } |
| 81 void bindVertexBuffer(GrGLuint id) { | 81 void bindVertexBuffer(GrGLuint id) { |
| 82 fHWGeometryState.setVertexBufferID(this, id); | 82 fHWGeometryState.setVertexBufferID(this, id); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // These callbacks update state tracking when GL objects are deleted. They a
re called from | 85 // These callbacks update state tracking when GL objects are deleted. They a
re called from |
| 86 // GrGLResource onRelease functions. | 86 // GrGLResource onRelease functions. |
| 87 void notifyVertexArrayDelete(GrGLuint id) { | 87 void notifyVertexArrayDelete(GrGLuint id) { |
| 88 fHWGeometryState.notifyVertexArrayDelete(id); | 88 fHWGeometryState.notifyVertexArrayDelete(id); |
| 89 } | 89 } |
| 90 void notifyVertexBufferDelete(GrGLuint id) { | 90 void notifyVertexBufferDelete(GrGLuint id) { |
| 91 fHWGeometryState.notifyVertexBufferDelete(id); | 91 fHWGeometryState.notifyVertexBufferDelete(id); |
| 92 } | 92 } |
| 93 void notifyIndexBufferDelete(GrGLuint id) { | 93 void notifyIndexBufferDelete(GrGLuint id) { |
| 94 fHWGeometryState.notifyIndexBufferDelete(id); | 94 fHWGeometryState.notifyIndexBufferDelete(id); |
| 95 } | 95 } |
| 96 | 96 |
| 97 // DrawTarget overrides | 97 bool copySurface(GrSurface* dst, |
| 98 virtual bool copySurface(GrSurface* dst, | 98 GrSurface* src, |
| 99 GrSurface* src, | 99 const SkIRect& srcRect, |
| 100 const SkIRect& srcRect, | 100 const SkIPoint& dstPoint) SK_OVERRIDE; |
| 101 const SkIPoint& dstPoint) SK_OVERRIDE; | |
| 102 | 101 |
| 103 virtual bool canCopySurface(const GrSurface* dst, | 102 bool canCopySurface(const GrSurface* dst, |
| 104 const GrSurface* src, | 103 const GrSurface* src, |
| 105 const SkIRect& srcRect, | 104 const SkIRect& srcRect, |
| 106 const SkIPoint& dstPoint) SK_OVERRIDE; | 105 const SkIPoint& dstPoint) SK_OVERRIDE; |
| 107 | 106 |
| 108 protected: | 107 protected: |
| 109 virtual void buildProgramDesc(const GrOptDrawState&, | 108 virtual void buildProgramDesc(const GrOptDrawState&, |
| 110 const GrProgramDesc::DescInfo&, | 109 const GrProgramDesc::DescInfo&, |
| 111 GrGpu::DrawType, | 110 GrGpu::DrawType, |
| 112 GrProgramDesc*) SK_OVERRIDE; | 111 GrProgramDesc*) SK_OVERRIDE; |
| 113 | 112 |
| 114 private: | 113 private: |
| 115 // GrGpu overrides | 114 // GrGpu overrides |
| 116 virtual void onResetContext(uint32_t resetBits) SK_OVERRIDE; | 115 virtual void onResetContext(uint32_t resetBits) SK_OVERRIDE; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 448 |
| 450 // we record what stencil format worked last time to hopefully exit early | 449 // we record what stencil format worked last time to hopefully exit early |
| 451 // from our loop that tries stencil formats and calls check fb status. | 450 // from our loop that tries stencil formats and calls check fb status. |
| 452 int fLastSuccessfulStencilFmtIdx; | 451 int fLastSuccessfulStencilFmtIdx; |
| 453 | 452 |
| 454 typedef GrGpu INHERITED; | 453 typedef GrGpu INHERITED; |
| 455 friend class GrGLPathRendering; // For accessing setTextureUnit. | 454 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 456 }; | 455 }; |
| 457 | 456 |
| 458 #endif | 457 #endif |
| OLD | NEW |