Loading core/jni/android_view_GLES20Canvas.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ static void android_view_GLES20Canvas_destroyDisplayList(JNIEnv* env, static void android_view_GLES20Canvas_drawDisplayList(JNIEnv* env, jobject canvas, OpenGLRenderer* renderer, DisplayList* displayList) { displayList->replay(*renderer); renderer->drawDisplayList(displayList); } #endif // USE_OPENGL_RENDERER Loading libs/hwui/DisplayListRenderer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,10 @@ void DisplayList::replay(OpenGLRenderer& renderer) { (SkRegion::Op) getInt()); } break; case DrawDisplayList: { renderer.drawDisplayList(getDisplayList()); } break; case DrawBitmap: { renderer.drawBitmap(getBitmap(), getFloat(), getFloat(), getPaint()); } Loading Loading @@ -453,6 +457,11 @@ bool DisplayListRenderer::clipRect(float left, float top, float right, float bot return OpenGLRenderer::clipRect(left, top, right, bottom, op); } void DisplayListRenderer::drawDisplayList(DisplayList* displayList) { addOp(DisplayList::DrawDisplayList); addDisplayList(displayList); } void DisplayListRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint) { addOp(DisplayList::DrawBitmap); Loading libs/hwui/DisplayListRenderer.h +21 −6 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public: SetMatrix, ConcatMatrix, ClipRect, DrawDisplayList, DrawBitmap, DrawBitmapMatrix, DrawBitmapRect, Loading Loading @@ -160,6 +161,10 @@ private: return (SkPaint*) getInt(); } DisplayList* getDisplayList() { return (DisplayList*) getInt(); } inline float getFloat() { return mReader.readScalar(); } Loading Loading @@ -235,6 +240,7 @@ public: bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op); void drawDisplayList(DisplayList* displayList); void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop, Loading Loading @@ -351,15 +357,24 @@ private: addInt((int) NULL); return; } SkPaint *paintCopy = mPaintMap.valueFor(paint); if (paintCopy == NULL || paintCopy->getGenerationID() != paint->getGenerationID()) { paintCopy = new SkPaint(*paint); mPaintMap.add(paint, paintCopy); mPaints.add(paintCopy); } addInt((int) paintCopy); } inline void addDisplayList(DisplayList* displayList) { // TODO: To be safe, the display list should be ref-counted in the // resources cache, but we rely on the caller (UI toolkit) to // do the right thing for now addInt((int) displayList); } inline void addMatrix(SkMatrix* matrix) { // Copying the matrix is cheap and prevents against the user changing the original // matrix before the operation that uses it Loading libs/hwui/OpenGLDebugRenderer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,12 @@ int OpenGLDebugRenderer::saveLayer(float left, float top, float right, float bot return OpenGLRenderer::saveLayer(left, top, right, bottom, p, flags); } void OpenGLDebugRenderer::drawDisplayList(DisplayList* displayList) { mPrimitivesCount++; StopWatch w("drawDisplayList"); OpenGLRenderer::drawDisplayList(displayList); } void OpenGLDebugRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint) { mPrimitivesCount++; Loading libs/hwui/OpenGLDebugRenderer.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ public: int saveLayer(float left, float top, float right, float bottom, SkPaint* p, int flags); void drawDisplayList(DisplayList* displayList); void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop, Loading Loading
core/jni/android_view_GLES20Canvas.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ static void android_view_GLES20Canvas_destroyDisplayList(JNIEnv* env, static void android_view_GLES20Canvas_drawDisplayList(JNIEnv* env, jobject canvas, OpenGLRenderer* renderer, DisplayList* displayList) { displayList->replay(*renderer); renderer->drawDisplayList(displayList); } #endif // USE_OPENGL_RENDERER Loading
libs/hwui/DisplayListRenderer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,10 @@ void DisplayList::replay(OpenGLRenderer& renderer) { (SkRegion::Op) getInt()); } break; case DrawDisplayList: { renderer.drawDisplayList(getDisplayList()); } break; case DrawBitmap: { renderer.drawBitmap(getBitmap(), getFloat(), getFloat(), getPaint()); } Loading Loading @@ -453,6 +457,11 @@ bool DisplayListRenderer::clipRect(float left, float top, float right, float bot return OpenGLRenderer::clipRect(left, top, right, bottom, op); } void DisplayListRenderer::drawDisplayList(DisplayList* displayList) { addOp(DisplayList::DrawDisplayList); addDisplayList(displayList); } void DisplayListRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint) { addOp(DisplayList::DrawBitmap); Loading
libs/hwui/DisplayListRenderer.h +21 −6 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public: SetMatrix, ConcatMatrix, ClipRect, DrawDisplayList, DrawBitmap, DrawBitmapMatrix, DrawBitmapRect, Loading Loading @@ -160,6 +161,10 @@ private: return (SkPaint*) getInt(); } DisplayList* getDisplayList() { return (DisplayList*) getInt(); } inline float getFloat() { return mReader.readScalar(); } Loading Loading @@ -235,6 +240,7 @@ public: bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op); void drawDisplayList(DisplayList* displayList); void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop, Loading Loading @@ -351,15 +357,24 @@ private: addInt((int) NULL); return; } SkPaint *paintCopy = mPaintMap.valueFor(paint); if (paintCopy == NULL || paintCopy->getGenerationID() != paint->getGenerationID()) { paintCopy = new SkPaint(*paint); mPaintMap.add(paint, paintCopy); mPaints.add(paintCopy); } addInt((int) paintCopy); } inline void addDisplayList(DisplayList* displayList) { // TODO: To be safe, the display list should be ref-counted in the // resources cache, but we rely on the caller (UI toolkit) to // do the right thing for now addInt((int) displayList); } inline void addMatrix(SkMatrix* matrix) { // Copying the matrix is cheap and prevents against the user changing the original // matrix before the operation that uses it Loading
libs/hwui/OpenGLDebugRenderer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,12 @@ int OpenGLDebugRenderer::saveLayer(float left, float top, float right, float bot return OpenGLRenderer::saveLayer(left, top, right, bottom, p, flags); } void OpenGLDebugRenderer::drawDisplayList(DisplayList* displayList) { mPrimitivesCount++; StopWatch w("drawDisplayList"); OpenGLRenderer::drawDisplayList(displayList); } void OpenGLDebugRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint) { mPrimitivesCount++; Loading
libs/hwui/OpenGLDebugRenderer.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ public: int saveLayer(float left, float top, float right, float bottom, SkPaint* p, int flags); void drawDisplayList(DisplayList* displayList); void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop, Loading