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

Unified Diff: src/gpu/GrGpu.cpp

Issue 1139753002: Refactor GrBufferAllocPools to use resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix merge issue Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrIndexBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index d46d09d5c7b5544ff828fa552235575ceecef67a..728fb880622010fa9495932d467b7f6df7d3ff04 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,
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrIndexBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698