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

Unified Diff: src/gpu/GrResourceProvider.cpp

Issue 1534123003: More framework support for TransferBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrResourceProvider.cpp
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 38213e6266330c9c2e66a4e52bec36ce7e026160..a240ea0767c600d68357450953c9adb3837d8169 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -146,6 +146,18 @@ GrVertexBuffer* GrResourceProvider::createVertexBuffer(size_t size, BufferUsage
return this->gpu()->createVertexBuffer(size, dynamic);
}
+GrTransferBuffer* GrResourceProvider::createTransferBuffer(size_t size, TransferType type,
+ uint32_t flags) {
+ if (this->isAbandoned()) {
+ return nullptr;
+ }
+
+ //bool noPendingIO = SkToBool(flags & kNoPendingIO_Flag);
+ GrGpu::TransferType gpuType = kCpuToGpu_TransferType == type ? GrGpu::kCpuToGpu_TransferType
+ : GrGpu::kGpuToCpu_TransferType;
+ return this->gpu()->createTransferBuffer(size, gpuType);
+}
+
GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config,
int width, int height,
int numPlotsX, int numPlotsY,
@@ -164,7 +176,7 @@ GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config,
if (!texture) {
return nullptr;
}
- GrBatchAtlas* atlas = new GrBatchAtlas(texture, numPlotsX, numPlotsY);
+ GrBatchAtlas* atlas = new GrBatchAtlas(this, texture, numPlotsX, numPlotsY);
atlas->registerEvictionCallback(func, data);
return atlas;
}

Powered by Google App Engine
This is Rietveld 408576698