Loading core/jni/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ cc_library_shared { ], cppflags: ["-Wno-conversion-null"], cpp_std: "c++17", srcs: [ "AndroidRuntime.cpp", Loading libs/hwui/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ cc_defaults { //"hwui_compile_for_perf", ], cpp_std: "c++17", cflags: [ "-DEGL_EGLEXT_PROTOTYPES", "-DGL_GLEXT_PROTOTYPES", Loading Loading @@ -354,6 +356,7 @@ cc_test { "tests/unit/TestUtilsTests.cpp", "tests/unit/TextDropShadowCacheTests.cpp", "tests/unit/TextureCacheTests.cpp", "tests/unit/ThreadBaseTests.cpp", "tests/unit/TypefaceTests.cpp", "tests/unit/VectorDrawableTests.cpp", "tests/unit/VectorDrawableAtlasTests.cpp", Loading libs/hwui/SwapBehavior.h 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 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 HWUI_SWAPBEHAVIOR_H #define HWUI_SWAPBEHAVIOR_H namespace android { namespace uirenderer { namespace renderthread { enum class SwapBehavior { kSwap_default, kSwap_discardBuffer, }; } // namespace renderthread } //namespace uirenderer } // namespace android #endif //HWUI_SWAPBEHAVIOR_H libs/hwui/renderstate/RenderState.cpp +1 −15 Original line number Diff line number Diff line Loading @@ -236,25 +236,11 @@ void RenderState::destroyLayersInUpdater() { std::for_each(mActiveLayerUpdaters.begin(), mActiveLayerUpdaters.end(), destroyLayerInUpdater); } class DecStrongTask : public renderthread::RenderTask { public: explicit DecStrongTask(VirtualLightRefBase* object) : mObject(object) {} virtual void run() override { mObject->decStrong(nullptr); mObject = nullptr; delete this; } private: VirtualLightRefBase* mObject; }; void RenderState::postDecStrong(VirtualLightRefBase* object) { if (pthread_equal(mThreadId, pthread_self())) { object->decStrong(nullptr); } else { mRenderThread.queue(new DecStrongTask(object)); mRenderThread.queue().post([object]() { object->decStrong(nullptr); }); } } Loading libs/hwui/renderthread/CanvasContext.cpp +4 −12 Original line number Diff line number Diff line Loading @@ -181,13 +181,13 @@ void CanvasContext::destroy() { mAnimationContext->destroy(); } void CanvasContext::setSurface(Surface* surface) { void CanvasContext::setSurface(sp<Surface>&& surface) { ATRACE_CALL(); mNativeSurface = surface; mNativeSurface = std::move(surface); ColorMode colorMode = mWideColorGamut ? ColorMode::WideColorGamut : ColorMode::Srgb; bool hasSurface = mRenderPipeline->setSurface(surface, mSwapBehavior, colorMode); bool hasSurface = mRenderPipeline->setSurface(mNativeSurface.get(), mSwapBehavior, colorMode); mFrameNumber = -1; Loading @@ -203,15 +203,7 @@ void CanvasContext::setSwapBehavior(SwapBehavior swapBehavior) { mSwapBehavior = swapBehavior; } void CanvasContext::initialize(Surface* surface) { setSurface(surface); } void CanvasContext::updateSurface(Surface* surface) { setSurface(surface); } bool CanvasContext::pauseSurface(Surface* surface) { bool CanvasContext::pauseSurface() { return mRenderThread.removeFrameCallback(this); } Loading Loading
core/jni/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ cc_library_shared { ], cppflags: ["-Wno-conversion-null"], cpp_std: "c++17", srcs: [ "AndroidRuntime.cpp", Loading
libs/hwui/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ cc_defaults { //"hwui_compile_for_perf", ], cpp_std: "c++17", cflags: [ "-DEGL_EGLEXT_PROTOTYPES", "-DGL_GLEXT_PROTOTYPES", Loading Loading @@ -354,6 +356,7 @@ cc_test { "tests/unit/TestUtilsTests.cpp", "tests/unit/TextDropShadowCacheTests.cpp", "tests/unit/TextureCacheTests.cpp", "tests/unit/ThreadBaseTests.cpp", "tests/unit/TypefaceTests.cpp", "tests/unit/VectorDrawableTests.cpp", "tests/unit/VectorDrawableAtlasTests.cpp", Loading
libs/hwui/SwapBehavior.h 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 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 HWUI_SWAPBEHAVIOR_H #define HWUI_SWAPBEHAVIOR_H namespace android { namespace uirenderer { namespace renderthread { enum class SwapBehavior { kSwap_default, kSwap_discardBuffer, }; } // namespace renderthread } //namespace uirenderer } // namespace android #endif //HWUI_SWAPBEHAVIOR_H
libs/hwui/renderstate/RenderState.cpp +1 −15 Original line number Diff line number Diff line Loading @@ -236,25 +236,11 @@ void RenderState::destroyLayersInUpdater() { std::for_each(mActiveLayerUpdaters.begin(), mActiveLayerUpdaters.end(), destroyLayerInUpdater); } class DecStrongTask : public renderthread::RenderTask { public: explicit DecStrongTask(VirtualLightRefBase* object) : mObject(object) {} virtual void run() override { mObject->decStrong(nullptr); mObject = nullptr; delete this; } private: VirtualLightRefBase* mObject; }; void RenderState::postDecStrong(VirtualLightRefBase* object) { if (pthread_equal(mThreadId, pthread_self())) { object->decStrong(nullptr); } else { mRenderThread.queue(new DecStrongTask(object)); mRenderThread.queue().post([object]() { object->decStrong(nullptr); }); } } Loading
libs/hwui/renderthread/CanvasContext.cpp +4 −12 Original line number Diff line number Diff line Loading @@ -181,13 +181,13 @@ void CanvasContext::destroy() { mAnimationContext->destroy(); } void CanvasContext::setSurface(Surface* surface) { void CanvasContext::setSurface(sp<Surface>&& surface) { ATRACE_CALL(); mNativeSurface = surface; mNativeSurface = std::move(surface); ColorMode colorMode = mWideColorGamut ? ColorMode::WideColorGamut : ColorMode::Srgb; bool hasSurface = mRenderPipeline->setSurface(surface, mSwapBehavior, colorMode); bool hasSurface = mRenderPipeline->setSurface(mNativeSurface.get(), mSwapBehavior, colorMode); mFrameNumber = -1; Loading @@ -203,15 +203,7 @@ void CanvasContext::setSwapBehavior(SwapBehavior swapBehavior) { mSwapBehavior = swapBehavior; } void CanvasContext::initialize(Surface* surface) { setSurface(surface); } void CanvasContext::updateSurface(Surface* surface) { setSurface(surface); } bool CanvasContext::pauseSurface(Surface* surface) { bool CanvasContext::pauseSurface() { return mRenderThread.removeFrameCallback(this); } Loading