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

Unified Diff: src/gpu/GrResourceProvider.cpp

Issue 1260183006: Move atlas creation to internal to GrResourceProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@debugatlas
Patch Set: tweak Created 5 years, 4 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/GrResourceProvider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceProvider.cpp
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index a79b67514eb2ee192197fa802a3f08d954509053..8b04caca4ecc29ae8155f5cf45cef038b08aad56 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -142,3 +142,24 @@ GrVertexBuffer* GrResourceProvider::createVertexBuffer(size_t size, BufferUsage
}
return this->gpu()->createVertexBuffer(size, dynamic);
}
+
+GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config,
+ int width, int height,
+ int numPlotsX, int numPlotsY,
+ GrBatchAtlas::EvictionFunc func, void* data) {
+ GrSurfaceDesc desc;
+ desc.fFlags = kNone_GrSurfaceFlags;
+ desc.fWidth = width;
+ desc.fHeight = height;
+ desc.fConfig = config;
+
+ // We don't want to flush the context so we claim we're in the middle of flushing so as to
+ // guarantee we do not recieve a texture with pending IO
+ // TODO: Determine how to avoid having to do this. (http://skbug.com/4156)
+ static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
+ GrTexture* texture = this->createApproxTexture(desc, kFlags);
+ if (!texture) {
+ return NULL;
+ }
+ return SkNEW_ARGS(GrBatchAtlas, (texture, numPlotsX, numPlotsY));
+}
« no previous file with comments | « src/gpu/GrResourceProvider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698