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

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

Issue 1490473003: Add transfer buffer support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix roll issue Created 5 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/gl/GrGLDefines.h ('k') | src/gpu/gl/GrGLGpu.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 GrGLGpu_DEFINED 8 #ifndef GrGLGpu_DEFINED
9 #define GrGLGpu_DEFINED 9 #define GrGLGpu_DEFINED
10 10
11 #include "GrGLContext.h" 11 #include "GrGLContext.h"
12 #include "GrGLIRect.h" 12 #include "GrGLIRect.h"
13 #include "GrGLIndexBuffer.h" 13 #include "GrGLIndexBuffer.h"
14 #include "GrGLPathRendering.h" 14 #include "GrGLPathRendering.h"
15 #include "GrGLProgram.h" 15 #include "GrGLProgram.h"
16 #include "GrGLRenderTarget.h" 16 #include "GrGLRenderTarget.h"
17 #include "GrGLStencilAttachment.h" 17 #include "GrGLStencilAttachment.h"
18 #include "GrGLTexture.h" 18 #include "GrGLTexture.h"
19 #include "GrGLTransferBuffer.h"
19 #include "GrGLVertexArray.h" 20 #include "GrGLVertexArray.h"
20 #include "GrGLVertexBuffer.h" 21 #include "GrGLVertexBuffer.h"
21 #include "GrGpu.h" 22 #include "GrGpu.h"
22 #include "GrPipelineBuilder.h" 23 #include "GrPipelineBuilder.h"
23 #include "GrXferProcessor.h" 24 #include "GrXferProcessor.h"
24 #include "SkTypes.h" 25 #include "SkTypes.h"
25 26
26 class GrPipeline; 27 class GrPipeline;
27 class GrNonInstancedVertices; 28 class GrNonInstancedVertices;
28 29
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void buildProgramDesc(GrProgramDesc*, 95 void buildProgramDesc(GrProgramDesc*,
95 const GrPrimitiveProcessor&, 96 const GrPrimitiveProcessor&,
96 const GrPipeline&) const override; 97 const GrPipeline&) const override;
97 98
98 // id and type (GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER) of buffer to bin d 99 // id and type (GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER) of buffer to bin d
99 void bindBuffer(GrGLuint id, GrGLenum type); 100 void bindBuffer(GrGLuint id, GrGLenum type);
100 101
101 void releaseBuffer(GrGLuint id, GrGLenum type); 102 void releaseBuffer(GrGLuint id, GrGLenum type);
102 103
103 // sizes are in bytes 104 // sizes are in bytes
104 void* mapBuffer(GrGLuint id, GrGLenum type, bool dynamic, size_t currentSize , 105 void* mapBuffer(GrGLuint id, GrGLenum type, GrGLBufferImpl::Usage usage, siz e_t currentSize,
105 size_t requestedSize); 106 size_t requestedSize);
106 107
107 void unmapBuffer(GrGLuint id, GrGLenum type, void* mapPtr); 108 void unmapBuffer(GrGLuint id, GrGLenum type, void* mapPtr);
108 109
109 void bufferData(GrGLuint id, GrGLenum type, bool dynamic, size_t currentSize , 110 void bufferData(GrGLuint id, GrGLenum type, GrGLBufferImpl::Usage usage, siz e_t currentSize,
110 const void* src, size_t srcSizeInBytes); 111 const void* src, size_t srcSizeInBytes);
111 112
112 const GrGLContext* glContextForTesting() const override { 113 const GrGLContext* glContextForTesting() const override {
113 return &this->glContext(); 114 return &this->glContext();
114 } 115 }
115 116
116 void clearStencil(GrRenderTarget*) override; 117 void clearStencil(GrRenderTarget*) override;
117 118
118 void invalidateBoundRenderTarget() { 119 void invalidateBoundRenderTarget() {
119 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; 120 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID;
(...skipping 16 matching lines...) Expand all
136 137
137 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; 138 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override;
138 139
139 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, 140 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle,
140 const void* srcData, size_t rowBytes) override; 141 const void* srcData, size_t rowBytes) override;
141 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, 142 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc,
142 GrGpuResource::LifeCycle lifeCycle, 143 GrGpuResource::LifeCycle lifeCycle,
143 const void* srcData) override; 144 const void* srcData) override;
144 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; 145 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override;
145 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; 146 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override;
147 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove rride;
146 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override; 148 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override;
147 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, 149 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
148 GrWrapOwnership) override; 150 GrWrapOwnership) override;
149 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a 151 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a
150 // compatible stencil format. 152 // compatible stencil format.
151 int getCompatibleStencilIndex(GrPixelConfig config); 153 int getCompatibleStencilIndex(GrPixelConfig config);
152 154
153 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; 155 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override;
154 156
155 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override; 157 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override;
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 527
526 // Mapping of pixel configs to known supported stencil formats to be used 528 // Mapping of pixel configs to known supported stencil formats to be used
527 // when adding a stencil buffer to a framebuffer. 529 // when adding a stencil buffer to a framebuffer.
528 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; 530 int fPixelConfigToStencilIndex[kGrPixelConfigCnt];
529 531
530 typedef GrGpu INHERITED; 532 typedef GrGpu INHERITED;
531 friend class GrGLPathRendering; // For accessing setTextureUnit. 533 friend class GrGLPathRendering; // For accessing setTextureUnit.
532 }; 534 };
533 535
534 #endif 536 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698