From 2af4635e4a9e448a65ff541252f8f94bc6ac48e0 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 26 Nov 2012 18:30:17 -0800 Subject: 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 --- libs/hwui/OpenGLRenderer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') 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]; -- cgit v1.2.3-59-g8ed1b