Add support to draw 9patches in OpenGL.
This change only adds the necessary API and stubs. The implementation
will be added in another change.
Change-Id: Ie50b8aff5868e78796cee331df15bdbf990d2ea1
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 304af2e..ae7719c 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -35,7 +35,7 @@
///////////////////////////////////////////////////////////////////////////////
// Debug
-#define DEBUG_LAYERS 1
+#define DEBUG_LAYERS 0
// These properties are defined in mega-bytes
#define PROPERTY_TEXTURE_CACHE_SIZE "ro.hwui.texture_cache_size"
@@ -521,6 +521,12 @@
resetDrawTextureTexCoords(0.0f, 0.0f, 1.0f, 1.0f);
}
+void OpenGLRenderer::drawPatch(SkBitmap* bitmap, Res_png_9patch* patch,
+ float left, float top, float right, float bottom, const SkPaint* paint) {
+ // TODO: Implement
+ LOGD("Draw 9patch, paddingLeft=%d", patch->paddingLeft);
+}
+
void OpenGLRenderer::drawColor(int color, SkXfermode::Mode mode) {
const Rect& clip = mSnapshot->clipRect;
drawColorRect(clip.left, clip.top, clip.right, clip.bottom, color, mode);
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index fa9592a..9da4b8e 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -26,6 +26,7 @@
#include <SkXfermode.h>
#include <utils/RefBase.h>
+#include <utils/ResourceTypes.h>
#include "Matrix.h"
#include "Program.h"
@@ -108,6 +109,8 @@
void drawBitmap(SkBitmap* bitmap, const SkMatrix* matrix, const SkPaint* paint);
void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom,
float dstLeft, float dstTop, float dstRight, float dstBottom, const SkPaint* paint);
+ void drawPatch(SkBitmap* bitmap, Res_png_9patch* patch, float left, float top,
+ float right, float bottom, const SkPaint* paint);
void drawColor(int color, SkXfermode::Mode mode);
void drawRect(float left, float top, float right, float bottom, const SkPaint* paint);