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

Unified Diff: src/gpu/GrBufferAllocPool.cpp

Issue 1261643004: Some cleanup in GrTextureProvider and GrResourceProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@pathargs
Patch Set: fix Created 5 years, 5 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
Index: src/gpu/GrBufferAllocPool.cpp
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index e9172108f33707485df1a39454121f5e21ad96f8..78bb7ad66afa75b87b29460a736b9d408c429481 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -302,11 +302,14 @@ GrGeometryBuffer* GrBufferAllocPool::getBuffer(size_t size) {
GrResourceProvider* rp = fGpu->getContext()->resourceProvider();
+ static const GrResourceProvider::BufferUsage kUsage = GrResourceProvider::kDynamic_BufferUsage;
+ // Shouldn't have to use this flag (http://skbug.com/4156)
+ static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
if (kIndex_BufferType == fBufferType) {
- return rp->getIndexBuffer(size, /* dynamic = */ true, /* duringFlush = */ true);
+ return rp->createIndexBuffer(size, kUsage, kFlags);
} else {
SkASSERT(kVertex_BufferType == fBufferType);
- return rp->getVertexBuffer(size, /* dynamic = */ true, /* duringFlush = */ true);
+ return rp->createVertexBuffer(size, kUsage, kFlags);
}
}

Powered by Google App Engine
This is Rietveld 408576698