summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Patch.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Patch.h')
-rw-r--r--libs/hwui/Patch.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/libs/hwui/Patch.h b/libs/hwui/Patch.h
index 1ba045d..b63bd24 100644
--- a/libs/hwui/Patch.h
+++ b/libs/hwui/Patch.h
@@ -27,38 +27,35 @@
#include "Rect.h"
#include "UvMapper.h"
-#include "Vertex.h"
namespace android {
namespace uirenderer {
+struct TextureVertex;
+
///////////////////////////////////////////////////////////////////////////////
// 9-patch structures
///////////////////////////////////////////////////////////////////////////////
class Patch {
public:
- Patch();
- ~Patch();
+ Patch(const float bitmapWidth, const float bitmapHeight,
+ float width, float height,
+ const UvMapper& mapper, const Res_png_9patch* patch);
/**
* Returns the size of this patch's mesh in bytes.
*/
uint32_t getSize() const;
- TextureVertex* vertices;
- uint32_t verticesCount;
- uint32_t indexCount;
- bool hasEmptyQuads;
+ std::unique_ptr<TextureVertex[]> vertices;
+ uint32_t verticesCount = 0;
+ uint32_t indexCount = 0;
+ bool hasEmptyQuads = false;
Vector<Rect> quads;
- GLintptr offset;
- GLintptr textureOffset;
-
- TextureVertex* createMesh(const float bitmapWidth, const float bitmapHeight,
- float width, float height, const Res_png_9patch* patch);
- TextureVertex* createMesh(const float bitmapWidth, const float bitmapHeight,
- float width, float height, const UvMapper& mapper, const Res_png_9patch* patch);
+ GLintptr positionOffset = 0;
+ GLintptr textureOffset = 0;
private:
void generateRow(const int32_t* xDivs, uint32_t xCount, TextureVertex*& vertex,