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 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* des
c) SK_OVERRIDE; | 71 virtual void 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 bool copySurface(GrSurface* dst, | 97 // DrawTarget overrides |
98 GrSurface* src, | 98 virtual bool copySurface(GrSurface* dst, |
99 const SkIRect& srcRect, | 99 GrSurface* src, |
100 const SkIPoint& dstPoint) SK_OVERRIDE; | 100 const SkIRect& srcRect, |
| 101 const SkIPoint& dstPoint) SK_OVERRIDE; |
101 | 102 |
102 bool canCopySurface(const GrSurface* dst, | 103 virtual bool canCopySurface(const GrSurface* dst, |
103 const GrSurface* src, | 104 const GrSurface* src, |
104 const SkIRect& srcRect, | 105 const SkIRect& srcRect, |
105 const SkIPoint& dstPoint) SK_OVERRIDE; | 106 const SkIPoint& dstPoint) SK_OVERRIDE; |
106 | 107 |
107 protected: | 108 protected: |
108 virtual void buildProgramDesc(const GrOptDrawState&, | 109 virtual void buildProgramDesc(const GrOptDrawState&, |
109 const GrProgramDesc::DescInfo&, | 110 const GrProgramDesc::DescInfo&, |
110 GrGpu::DrawType, | 111 GrGpu::DrawType, |
111 GrProgramDesc*) SK_OVERRIDE; | 112 GrProgramDesc*) SK_OVERRIDE; |
112 | 113 |
113 private: | 114 private: |
114 // GrGpu overrides | 115 // GrGpu overrides |
115 virtual void onResetContext(uint32_t resetBits) SK_OVERRIDE; | 116 virtual void onResetContext(uint32_t resetBits) SK_OVERRIDE; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 449 |
449 // we record what stencil format worked last time to hopefully exit early | 450 // we record what stencil format worked last time to hopefully exit early |
450 // from our loop that tries stencil formats and calls check fb status. | 451 // from our loop that tries stencil formats and calls check fb status. |
451 int fLastSuccessfulStencilFmtIdx; | 452 int fLastSuccessfulStencilFmtIdx; |
452 | 453 |
453 typedef GrGpu INHERITED; | 454 typedef GrGpu INHERITED; |
454 friend class GrGLPathRendering; // For accessing setTextureUnit. | 455 friend class GrGLPathRendering; // For accessing setTextureUnit. |
455 }; | 456 }; |
456 | 457 |
457 #endif | 458 #endif |
OLD | NEW |