summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-11-26 18:30:17 -0800
committerChris Craik <ccraik@google.com>2013-01-22 13:47:03 -0800
commit2af4635e4a9e448a65ff541252f8f94bc6ac48e0 (patch)
tree2ea27d507f81660cdbb8e2cdf48cce875c1b8cdd /libs/hwui/OpenGLRenderer.cpp
parent878749fef09c7cb5894f77d9b032f876f9476e47 (diff)
Object-based DisplayList recording
bug:8037003 Changes the DisplayList from using stream read/write commands to use an array of objects manually allocated on a linear buffer. Depends on frameworks/native change https://googleplex-android-review.googlesource.com/#/c/257695/ which adds LinearAllocator Also changes drawRects to use float count instead of rect count, to be more like drawLines/drawPoints Change-Id: Ia2e4a11acd8f0a757042a05cbc9e7563cb73ee47
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index f55bc9d2a381..c9e51bb46b53 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1096,7 +1096,7 @@ void OpenGLRenderer::drawRegionRects(const SkRegion& region, int color,
rects.push(r.fTop);
rects.push(r.fRight);
rects.push(r.fBottom);
- count++;
+ count += 4;
it.next();
}
@@ -1732,7 +1732,7 @@ status_t OpenGLRenderer::drawDisplayList(DisplayList* displayList,
void OpenGLRenderer::outputDisplayList(DisplayList* displayList, uint32_t level) {
if (displayList) {
- displayList->output(*this, level);
+ displayList->output(level);
}
}
@@ -2082,7 +2082,6 @@ status_t OpenGLRenderer::drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const
*/
void OpenGLRenderer::drawConvexPath(const SkPath& path, SkPaint* paint) {
int color = paint->getColor();
- SkPaint::Style style = paint->getStyle();
SkXfermode::Mode mode = getXfermode(paint->getXfermode());
bool isAA = paint->isAntiAlias();
@@ -3193,8 +3192,7 @@ status_t OpenGLRenderer::drawColorRects(const float* rects, int count, int color
Vertex mesh[count * 6];
Vertex* vertex = mesh;
- for (int i = 0; i < count; i++) {
- int index = i * 4;
+ for (int index = 0; index < count; index += 4) {
float l = rects[index + 0];
float t = rects[index + 1];
float r = rects[index + 2];