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)); |
+} |