aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-06-24 06:54:10 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-24 06:54:10 -0700
commit1b8e1b5c499e31a671232c8ccb10e778e0d8b154 (patch)
tree75f4194d8fe6fbd04ffef72fd0da912646b996d2 /src/gpu/GrGpu.cpp
parent8bcc7a00febd737f7e82513bd5e4a697526626de (diff)
Refactor GrBufferAllocPools to use resource cache
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index d46d09d5c7..728fb88062 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -199,12 +199,20 @@ GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc&
GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) {
this->handleDirtyContext();
- return this->onCreateVertexBuffer(size, dynamic);
+ GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic);
+ if (!this->caps()->reuseScratchBuffers()) {
+ vb->resourcePriv().removeScratchKey();
+ }
+ return vb;
}
GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) {
this->handleDirtyContext();
- return this->onCreateIndexBuffer(size, dynamic);
+ GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic);
+ if (!this->caps()->reuseScratchBuffers()) {
+ ib->resourcePriv().removeScratchKey();
+ }
+ return ib;
}
void GrGpu::clear(const SkIRect* rect,