Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: src/gpu/gl/GrGpuGL.h

Issue 763593002: Revert of some cleanup around GrGpu/GrDrawTarget copySurface (Closed) Base URL: https://skia.googlesource.com/skia.git@isSameAs
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698