aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceProvider.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-08-05 06:36:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-05 06:36:39 -0700
commitb356cbc765468e2594fca9ec6e5476a3da145d26 (patch)
tree279fbe0808031d994f88e180f184fae6af9d4a7d /src/gpu/GrResourceProvider.h
parent093b4e8f51ab3432cc22ae506a2bd036d5716c98 (diff)
Move atlas creation to internal to GrResourceProvider
Diffstat (limited to 'src/gpu/GrResourceProvider.h')
-rw-r--r--src/gpu/GrResourceProvider.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 9ba1426fb6..f0f28ff2cc 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,