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

Unified Diff: src/gpu/GrResourceProvider.h

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/GrBatchFontCache.cpp ('k') | src/gpu/GrResourceProvider.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceProvider.h
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 9ba1426fb6e73c425dfedaf4250e1033ef060ded..f0f28ff2cc7a6785aad93eb7e53e5661bb8b90a6 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -8,10 +8,12 @@
#ifndef GrResourceProvider_DEFINED
#define GrResourceProvider_DEFINED
+#include "GrBatchAtlas.h"
#include "GrIndexBuffer.h"
#include "GrTextureProvider.h"
#include "GrPathRange.h"
+class GrBatchAtlas;
class GrIndexBuffer;
class GrPath;
class GrStrokeInfo;
@@ -113,6 +115,25 @@ public:
return this->internalCreateApproxTexture(desc, flags);
}
+ /** Returns a GrBatchAtlas. This function can be called anywhere, but the returned atlas should
+ * only be used inside of GrBatch::generateGeometry
+ * @param GrPixelConfig The pixel config which this atlas will store
+ * @param width width in pixels of the atlas
+ * @param height height in pixels of the atlas
+ * @param numPlotsX The number of plots the atlas should be broken up into in the X
+ * direction
+ * @param numPlotsY The number of plots the atlas should be broken up into in the Y
+ * direction
+ * @param func An eviction function which will be called whenever the atlas has to
+ * evict data
+ * @param data User supplied data which will be passed into func whenver an
+ * eviction occurs
+ *
+ * @return An initialized GrBatchAtlas, or NULL if creation fails
+ */
+ GrBatchAtlas* createAtlas(GrPixelConfig, int width, int height, int numPlotsX, int numPlotsY,
+ GrBatchAtlas::EvictionFunc func, void* data);
+
private:
const GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern,
int patternSize,
« no previous file with comments | « src/gpu/GrBatchFontCache.cpp ('k') | src/gpu/GrResourceProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698