Chromium Code Reviews| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 #if GR_GPU_STATS | |
| 98 virtual const GrContext::GPUStats& gpuStats() const SK_OVERRIDE { return fGP UStats; } | |
| 99 GrContext::GPUStats fGPUStats; | |
|
bsalomon
2014/09/17 18:50:16
Instead of making this public and passing GrGpuGL
| |
| 100 #endif | |
| 101 | |
| 97 protected: | 102 protected: |
| 98 virtual bool onCopySurface(GrSurface* dst, | 103 virtual bool onCopySurface(GrSurface* dst, |
| 99 GrSurface* src, | 104 GrSurface* src, |
| 100 const SkIRect& srcRect, | 105 const SkIRect& srcRect, |
| 101 const SkIPoint& dstPoint) SK_OVERRIDE; | 106 const SkIPoint& dstPoint) SK_OVERRIDE; |
| 102 | 107 |
| 103 virtual bool onCanCopySurface(GrSurface* dst, | 108 virtual bool onCanCopySurface(GrSurface* dst, |
| 104 GrSurface* src, | 109 GrSurface* src, |
| 105 const SkIRect& srcRect, | 110 const SkIRect& srcRect, |
| 106 const SkIPoint& dstPoint) SK_OVERRIDE; | 111 const SkIPoint& dstPoint) SK_OVERRIDE; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; | 148 virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; |
| 144 | 149 |
| 145 virtual void onGpuDraw(const DrawInfo&) SK_OVERRIDE; | 150 virtual void onGpuDraw(const DrawInfo&) SK_OVERRIDE; |
| 146 | 151 |
| 147 | 152 |
| 148 virtual void clearStencil(GrRenderTarget*) SK_OVERRIDE; | 153 virtual void clearStencil(GrRenderTarget*) SK_OVERRIDE; |
| 149 virtual void clearStencilClip(GrRenderTarget*, const SkIRect& rect, | 154 virtual void clearStencilClip(GrRenderTarget*, const SkIRect& rect, |
| 150 bool insideClip) SK_OVERRIDE; | 155 bool insideClip) SK_OVERRIDE; |
| 151 virtual bool flushGraphicsState(DrawType, const GrDeviceCoordTexture* dstCop y) SK_OVERRIDE; | 156 virtual bool flushGraphicsState(DrawType, const GrDeviceCoordTexture* dstCop y) SK_OVERRIDE; |
| 152 | 157 |
| 153 // GrDrawTarget ovverides | 158 // GrDrawTarget overrides |
| 154 virtual void didAddGpuTraceMarker() SK_OVERRIDE; | 159 virtual void didAddGpuTraceMarker() SK_OVERRIDE; |
| 155 virtual void didRemoveGpuTraceMarker() SK_OVERRIDE; | 160 virtual void didRemoveGpuTraceMarker() SK_OVERRIDE; |
| 156 | 161 |
| 157 // binds texture unit in GL | 162 // binds texture unit in GL |
| 158 void setTextureUnit(int unitIdx); | 163 void setTextureUnit(int unitIdx); |
| 159 | 164 |
| 160 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset | 165 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset |
| 161 // an into the index buffer. It does not account for drawInfo.startIndex() b ut rather the start | 166 // an into the index buffer. It does not account for drawInfo.startIndex() b ut rather the start |
| 162 // index is relative to the returned offset. | 167 // index is relative to the returned offset. |
| 163 void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); | 168 void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 bool uploadCompressedTexData(const GrGLTexture::Desc& desc, | 265 bool uploadCompressedTexData(const GrGLTexture::Desc& desc, |
| 261 const void* data, | 266 const void* data, |
| 262 bool isNewTexture = true, | 267 bool isNewTexture = true, |
| 263 int left = 0, int top = 0, | 268 int left = 0, int top = 0, |
| 264 int width = -1, int height = -1); | 269 int width = -1, int height = -1); |
| 265 | 270 |
| 266 bool createRenderTargetObjects(int width, int height, | 271 bool createRenderTargetObjects(int width, int height, |
| 267 GrGLuint texID, | 272 GrGLuint texID, |
| 268 GrGLRenderTarget::Desc* desc); | 273 GrGLRenderTarget::Desc* desc); |
| 269 | 274 |
| 275 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport); | |
| 276 | |
| 270 GrGLContext fGLContext; | 277 GrGLContext fGLContext; |
| 271 | 278 |
| 272 // GL program-related state | 279 // GL program-related state |
| 273 ProgramCache* fProgramCache; | 280 ProgramCache* fProgramCache; |
| 274 SkAutoTUnref<GrGLProgram> fCurrentProgram; | 281 SkAutoTUnref<GrGLProgram> fCurrentProgram; |
| 275 | 282 |
| 276 /////////////////////////////////////////////////////////////////////////// | 283 /////////////////////////////////////////////////////////////////////////// |
| 277 ///@name Caching of GL State | 284 ///@name Caching of GL State |
| 278 ///@{ | 285 ///@{ |
| 279 int fHWActiveTextureUnitIdx; | 286 int fHWActiveTextureUnitIdx; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 | 445 |
| 439 // we record what stencil format worked last time to hopefully exit early | 446 // we record what stencil format worked last time to hopefully exit early |
| 440 // from our loop that tries stencil formats and calls check fb status. | 447 // from our loop that tries stencil formats and calls check fb status. |
| 441 int fLastSuccessfulStencilFmtIdx; | 448 int fLastSuccessfulStencilFmtIdx; |
| 442 | 449 |
| 443 typedef GrGpu INHERITED; | 450 typedef GrGpu INHERITED; |
| 444 friend class GrGLPathRendering; // For accessing setTextureUnit. | 451 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 445 }; | 452 }; |
| 446 | 453 |
| 447 #endif | 454 #endif |
| OLD | NEW |