diff options
-rw-r--r-- | core/java/android/view/ThreadedRenderer.java | 6 | ||||
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 3 | ||||
-rw-r--r-- | core/jni/android_view_ThreadedRenderer.cpp | 7 | ||||
-rw-r--r-- | libs/hwui/Android.bp | 5 | ||||
-rw-r--r-- | libs/hwui/RenderNode.cpp | 74 | ||||
-rw-r--r-- | libs/hwui/RenderNode.h | 1 | ||||
-rw-r--r-- | libs/hwui/protos/ProtoHelpers.h | 41 | ||||
-rw-r--r-- | libs/hwui/protos/hwui.proto | 99 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 37 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.h | 2 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.h | 2 | ||||
-rw-r--r-- | libs/hwui/tests/macrobench/main.cpp | 1 |
13 files changed, 0 insertions, 282 deletions
diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java index e03f5faa26f2..0872032a6714 100644 --- a/core/java/android/view/ThreadedRenderer.java +++ b/core/java/android/view/ThreadedRenderer.java @@ -907,10 +907,6 @@ public final class ThreadedRenderer { animator.getAnimatorNativePtr()); } - public void serializeDisplayListTree() { - nSerializeDisplayListTree(mNativeProxy); - } - public static int copySurfaceInto(Surface surface, Rect srcRect, Bitmap bitmap) { if (srcRect == null) { // Empty rect means entire surface @@ -1202,8 +1198,6 @@ public final class ThreadedRenderer { private static native void nStopDrawing(long nativeProxy); private static native void nNotifyFramePending(long nativeProxy); - private static native void nSerializeDisplayListTree(long nativeProxy); - private static native void nDumpProfileInfo(long nativeProxy, FileDescriptor fd, @DumpFlags int dumpFlags); diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 923127792a73..70054717590d 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -2961,9 +2961,6 @@ public final class ViewRootImpl implements ViewParent, */ void outputDisplayList(View view) { view.mRenderNode.output(); - if (mAttachInfo.mThreadedRenderer != null) { - mAttachInfo.mThreadedRenderer.serializeDisplayListTree(); - } } /** diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp index 7481f1c1fe53..a73939c7b52e 100644 --- a/core/jni/android_view_ThreadedRenderer.cpp +++ b/core/jni/android_view_ThreadedRenderer.cpp @@ -813,12 +813,6 @@ static void android_view_ThreadedRenderer_notifyFramePending(JNIEnv* env, jobjec proxy->notifyFramePending(); } -static void android_view_ThreadedRenderer_serializeDisplayListTree(JNIEnv* env, jobject clazz, - jlong proxyPtr) { - RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); - proxy->serializeDisplayListTree(); -} - static void android_view_ThreadedRenderer_dumpProfileInfo(JNIEnv* env, jobject clazz, jlong proxyPtr, jobject javaFileDescriptor, jint dumpFlags) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); @@ -1081,7 +1075,6 @@ static const JNINativeMethod gMethods[] = { { "nFence", "(J)V", (void*) android_view_ThreadedRenderer_fence }, { "nStopDrawing", "(J)V", (void*) android_view_ThreadedRenderer_stopDrawing }, { "nNotifyFramePending", "(J)V", (void*) android_view_ThreadedRenderer_notifyFramePending }, - { "nSerializeDisplayListTree", "(J)V", (void*) android_view_ThreadedRenderer_serializeDisplayListTree }, { "nDumpProfileInfo", "(JLjava/io/FileDescriptor;I)V", (void*) android_view_ThreadedRenderer_dumpProfileInfo }, { "setupShadersDiskCache", "(Ljava/lang/String;Ljava/lang/String;)V", (void*) android_view_ThreadedRenderer_setupShadersDiskCache }, diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp index 592a6e64a58b..de4eaf568d06 100644 --- a/libs/hwui/Android.bp +++ b/libs/hwui/Android.bp @@ -269,13 +269,8 @@ cc_defaults { "TextureCache.cpp", "VectorDrawable.cpp", "VkLayer.cpp", - "protos/hwui.proto", ], - proto: { - export_proto_headers: true, - }, - export_include_dirs: ["."], export_shared_lib_headers: ["libRScpp"], } diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index d93a7578cfd7..5ac330bcadb8 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -29,9 +29,6 @@ #include "utils/StringUtils.h" #include "utils/TraceUtils.h" -#include "protos/ProtoHelpers.h" -#include "protos/hwui.pb.h" - #include <SkPathOps.h> #include <algorithm> #include <sstream> @@ -101,77 +98,6 @@ void RenderNode::output(std::ostream& output, uint32_t level) { output << std::endl; } -void RenderNode::copyTo(proto::RenderNode* pnode) { - pnode->set_id(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(this))); - pnode->set_name(mName.string(), mName.length()); - - proto::RenderProperties* pprops = pnode->mutable_properties(); - pprops->set_left(properties().getLeft()); - pprops->set_top(properties().getTop()); - pprops->set_right(properties().getRight()); - pprops->set_bottom(properties().getBottom()); - pprops->set_clip_flags(properties().getClippingFlags()); - pprops->set_alpha(properties().getAlpha()); - pprops->set_translation_x(properties().getTranslationX()); - pprops->set_translation_y(properties().getTranslationY()); - pprops->set_translation_z(properties().getTranslationZ()); - pprops->set_elevation(properties().getElevation()); - pprops->set_rotation(properties().getRotation()); - pprops->set_rotation_x(properties().getRotationX()); - pprops->set_rotation_y(properties().getRotationY()); - pprops->set_scale_x(properties().getScaleX()); - pprops->set_scale_y(properties().getScaleY()); - pprops->set_pivot_x(properties().getPivotX()); - pprops->set_pivot_y(properties().getPivotY()); - pprops->set_has_overlapping_rendering(properties().getHasOverlappingRendering()); - pprops->set_pivot_explicitly_set(properties().isPivotExplicitlySet()); - pprops->set_project_backwards(properties().getProjectBackwards()); - pprops->set_projection_receiver(properties().isProjectionReceiver()); - set(pprops->mutable_clip_bounds(), properties().getClipBounds()); - - const Outline& outline = properties().getOutline(); - if (outline.getType() != Outline::Type::None) { - proto::Outline* poutline = pprops->mutable_outline(); - poutline->clear_path(); - if (outline.getType() == Outline::Type::Empty) { - poutline->set_type(proto::Outline_Type_Empty); - } else if (outline.getType() == Outline::Type::ConvexPath) { - poutline->set_type(proto::Outline_Type_ConvexPath); - if (const SkPath* path = outline.getPath()) { - set(poutline->mutable_path(), *path); - } - } else if (outline.getType() == Outline::Type::RoundRect) { - poutline->set_type(proto::Outline_Type_RoundRect); - } else { - ALOGW("Uknown outline type! %d", static_cast<int>(outline.getType())); - poutline->set_type(proto::Outline_Type_None); - } - poutline->set_should_clip(outline.getShouldClip()); - poutline->set_alpha(outline.getAlpha()); - poutline->set_radius(outline.getRadius()); - set(poutline->mutable_bounds(), outline.getBounds()); - } else { - pprops->clear_outline(); - } - - const RevealClip& revealClip = properties().getRevealClip(); - if (revealClip.willClip()) { - proto::RevealClip* prevealClip = pprops->mutable_reveal_clip(); - prevealClip->set_x(revealClip.getX()); - prevealClip->set_y(revealClip.getY()); - prevealClip->set_radius(revealClip.getRadius()); - } else { - pprops->clear_reveal_clip(); - } - - pnode->clear_children(); - if (mDisplayList) { - for (auto&& child : mDisplayList->getChildren()) { - child->renderNode->copyTo(pnode->add_children()); - } - } -} - int RenderNode::getDebugSize() { int size = sizeof(RenderNode); if (mStagingDisplayList) { diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h index 1469a156e2d8..1e0d4e2c2254 100644 --- a/libs/hwui/RenderNode.h +++ b/libs/hwui/RenderNode.h @@ -108,7 +108,6 @@ public: ANDROID_API void output(); ANDROID_API int getDebugSize(); - void copyTo(proto::RenderNode* node); bool isRenderable() const { return mDisplayList && !mDisplayList->isEmpty(); } diff --git a/libs/hwui/protos/ProtoHelpers.h b/libs/hwui/protos/ProtoHelpers.h deleted file mode 100644 index 833c77f2b8cb..000000000000 --- a/libs/hwui/protos/ProtoHelpers.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PROTOHELPERS_H -#define PROTOHELPERS_H - -#include "Rect.h" -#include "protos/hwui.pb.h" - -namespace android { -namespace uirenderer { - -void set(proto::RectF* dest, const Rect& src) { - dest->set_left(src.left); - dest->set_top(src.top); - dest->set_right(src.right); - dest->set_bottom(src.bottom); -} - -void set(std::string* dest, const SkPath& src) { - size_t size = src.writeToMemory(nullptr); - dest->resize(size); - src.writeToMemory(&*dest->begin()); -} - -} // namespace uirenderer -} // namespace android - -#endif // PROTOHELPERS_H diff --git a/libs/hwui/protos/hwui.proto b/libs/hwui/protos/hwui.proto deleted file mode 100644 index dcff80a24974..000000000000 --- a/libs/hwui/protos/hwui.proto +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -syntax = "proto2"; - -package android.uirenderer.proto; - -option optimize_for = LITE_RUNTIME; - -message RenderNode { - required uint64 id = 1; - required string name = 2; - required RenderProperties properties = 3; - optional DisplayList display_list = 4; - repeated RenderNode children = 5; -}; - -message RenderProperties { - required int32 left = 1; - required int32 right = 2; - required int32 top = 3; - required int32 bottom = 4; - required int32 clip_flags = 5; - required float alpha = 6; - required float translation_x = 7; - required float translation_y = 8; - required float translation_z = 9; - required float elevation = 10; - required float rotation = 11; - required float rotation_x = 12; - required float rotation_y = 13; - required float scale_x = 14; - required float scale_y = 15; - required float pivot_x = 16; - required float pivot_y = 17; - required bool has_overlapping_rendering = 18; - required bool pivot_explicitly_set = 19; - required bool project_backwards = 20; - required bool projection_receiver = 21; - required RectF clip_bounds = 22; - optional Outline outline = 23; - optional RevealClip reveal_clip = 24; -}; - -message RectF { - required float left = 1; - required float right = 2; - required float top = 3; - required float bottom = 4; -} - -message Outline { - required bool should_clip = 1; - enum Type { - None = 0; - Empty = 1; - ConvexPath = 2; - RoundRect = 3; - } - required Type type = 2; - required RectF bounds = 3; - required float radius = 4; - required float alpha = 5; - optional bytes path = 6; -} - -message RevealClip { - required float x = 1; - required float y = 2; - required float radius = 3; -} - -message DisplayList { - optional int32 projection_receive_index = 1; - repeated DrawOp draw_ops = 2; -} - -message DrawOp { - oneof drawop { - DrawOp_RenderNode render_node = 1; - } -} - -message DrawOp_RenderNode { - optional RenderNode node = 1; -} diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index f4d8051466f0..0e4b6f9e09be 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -29,7 +29,6 @@ #include "pipeline/skia/SkiaOpenGLPipeline.h" #include "pipeline/skia/SkiaPipeline.h" #include "pipeline/skia/SkiaVulkanPipeline.h" -#include "protos/hwui.pb.h" #include "renderstate/RenderState.h" #include "renderstate/Stencil.h" #include "utils/GLUtils.h" @@ -37,7 +36,6 @@ #include "../Properties.h" #include <cutils/properties.h> -#include <google/protobuf/io/zero_copy_stream_impl.h> #include <private/hwui/DrawGlInfo.h> #include <strings.h> @@ -50,8 +48,6 @@ #define TRIM_MEMORY_COMPLETE 80 #define TRIM_MEMORY_UI_HIDDEN 20 -#define ENABLE_RENDERNODE_SERIALIZATION false - #define LOG_FRAMETIME_MMA 0 #if LOG_FRAMETIME_MMA @@ -633,39 +629,6 @@ void CanvasContext::setName(const std::string&& name) { mJankTracker.setDescription(JankTrackerType::Window, std::move(name)); } -void CanvasContext::serializeDisplayListTree() { -#if ENABLE_RENDERNODE_SERIALIZATION - using namespace google::protobuf::io; - char package[128]; - // Check whether tracing is enabled for this process. - FILE* file = fopen("/proc/self/cmdline", "r"); - if (file) { - if (!fgets(package, 128, file)) { - ALOGE("Error reading cmdline: %s (%d)", strerror(errno), errno); - fclose(file); - return; - } - fclose(file); - } else { - ALOGE("Error opening /proc/self/cmdline: %s (%d)", strerror(errno), errno); - return; - } - char path[1024]; - snprintf(path, 1024, "/data/data/%s/cache/rendertree_dump", package); - int fd = open(path, O_CREAT | O_WRONLY, S_IRWXU | S_IRGRP | S_IROTH); - if (fd == -1) { - ALOGD("Failed to open '%s'", path); - return; - } - proto::RenderNode tree; - // TODO: Streaming writes? - mRootRenderNode->copyTo(&tree); - std::string data = tree.SerializeAsString(); - write(fd, data.c_str(), data.length()); - close(fd); -#endif -} - void CanvasContext::waitOnFences() { if (mFrameFences.size()) { ATRACE_CALL(); diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h index c2cc72a6917f..aaef85a5b1bc 100644 --- a/libs/hwui/renderthread/CanvasContext.h +++ b/libs/hwui/renderthread/CanvasContext.h @@ -155,8 +155,6 @@ public: void setName(const std::string&& name); - void serializeDisplayListTree(); - void addRenderNode(RenderNode* node, bool placeFront); void removeRenderNode(RenderNode* node); diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index c6a9b55f8ac1..39dcde0c7b1f 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -274,10 +274,6 @@ void RenderProxy::setFrameCallback(std::function<void(int64_t)>&& callback) { mDrawFrameTask.setFrameCallback(std::move(callback)); } -void RenderProxy::serializeDisplayListTree() { - mRenderThread.queue().post([=]() { mContext->serializeDisplayListTree(); }); -} - void RenderProxy::addFrameMetricsObserver(FrameMetricsObserver* observerPtr) { mRenderThread.queue().post([ this, observer = sp{observerPtr} ]() { mContext->addFrameMetricsObserver(observer.get()); diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index 3425c5c68a72..433adeb5eb37 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -109,8 +109,6 @@ public: ANDROID_API static void setProcessStatsBuffer(int fd); ANDROID_API int getRenderThreadTid(); - ANDROID_API void serializeDisplayListTree(); - ANDROID_API void addRenderNode(RenderNode* node, bool placeFront); ANDROID_API void removeRenderNode(RenderNode* node); ANDROID_API void drawRenderNode(RenderNode* node); diff --git a/libs/hwui/tests/macrobench/main.cpp b/libs/hwui/tests/macrobench/main.cpp index 0a9a74eccfc9..a56b1ddede7d 100644 --- a/libs/hwui/tests/macrobench/main.cpp +++ b/libs/hwui/tests/macrobench/main.cpp @@ -19,7 +19,6 @@ #include "Properties.h" #include "hwui/Typeface.h" -#include "protos/hwui.pb.h" #include <benchmark/benchmark.h> #include <getopt.h> |