Index: src/gpu/GrGpu.cpp |
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp |
index 35c04caa239cce0659e2c9b99b0d36b294bae2ee..177fbabc5936764a076cb9bb1943549773655e2e 100644 |
--- a/src/gpu/GrGpu.cpp |
+++ b/src/gpu/GrGpu.cpp |
@@ -8,10 +8,10 @@ |
#include "GrGpu.h" |
-#include "GrBuffer.h" |
#include "GrCaps.h" |
#include "GrContext.h" |
#include "GrGpuResourcePriv.h" |
+#include "GrIndexBuffer.h" |
#include "GrMesh.h" |
#include "GrPathRendering.h" |
#include "GrPipeline.h" |
@@ -20,6 +20,8 @@ |
#include "GrRenderTargetPriv.h" |
#include "GrStencilAttachment.h" |
#include "GrSurfacePriv.h" |
+#include "GrTransferBuffer.h" |
+#include "GrVertexBuffer.h" |
#include "SkTypes.h" |
GrMesh& GrMesh::operator =(const GrMesh& di) { |
@@ -236,13 +238,28 @@ |
return this->onWrapBackendTextureAsRenderTarget(desc, ownership); |
} |
-GrBuffer* GrGpu::createBuffer(GrBufferType type, size_t size, GrAccessPattern accessPattern) { |
- this->handleDirtyContext(); |
- GrBuffer* buffer = this->onCreateBuffer(type, size, accessPattern); |
+GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { |
+ this->handleDirtyContext(); |
+ GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic); |
if (!this->caps()->reuseScratchBuffers()) { |
- buffer->resourcePriv().removeScratchKey(); |
- } |
- return buffer; |
+ vb->resourcePriv().removeScratchKey(); |
+ } |
+ return vb; |
+} |
+ |
+GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { |
+ this->handleDirtyContext(); |
+ GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic); |
+ if (!this->caps()->reuseScratchBuffers()) { |
+ ib->resourcePriv().removeScratchKey(); |
+ } |
+ return ib; |
+} |
+ |
+GrTransferBuffer* GrGpu::createTransferBuffer(size_t size, TransferType type) { |
+ this->handleDirtyContext(); |
+ GrTransferBuffer* tb = this->onCreateTransferBuffer(size, type); |
+ return tb; |
} |
void GrGpu::clear(const SkIRect& rect, |
@@ -399,13 +416,13 @@ |
bool GrGpu::transferPixels(GrSurface* surface, |
int left, int top, int width, int height, |
- GrPixelConfig config, GrBuffer* transferBuffer, |
+ GrPixelConfig config, GrTransferBuffer* buffer, |
size_t offset, size_t rowBytes) { |
- SkASSERT(transferBuffer); |
+ SkASSERT(buffer); |
this->handleDirtyContext(); |
if (this->onTransferPixels(surface, left, top, width, height, config, |
- transferBuffer, offset, rowBytes)) { |
+ buffer, offset, rowBytes)) { |
fStats.incTransfersToTexture(); |
return true; |
} |