Loading libs/gui/Choreographer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ // #define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <gui/Choreographer.h> #include <gui/TraceUtils.h> #include <jni.h> #undef LOG_TAG Loading Loading @@ -297,6 +299,8 @@ void Choreographer::dispatchVsync(nsecs_t timestamp, PhysicalDisplayId, uint32_t mLastVsyncEventData = vsyncEventData; for (const auto& cb : callbacks) { if (cb.vsyncCallback != nullptr) { ATRACE_FORMAT("AChoreographer_vsyncCallback %" PRId64, vsyncEventData.preferredVsyncId()); const ChoreographerFrameCallbackDataImpl frameCallbackData = createFrameCallbackData(timestamp); registerStartTime(); Loading @@ -306,8 +310,10 @@ void Choreographer::dispatchVsync(nsecs_t timestamp, PhysicalDisplayId, uint32_t cb.data); mInCallback = false; } else if (cb.callback64 != nullptr) { ATRACE_FORMAT("AChoreographer_frameCallback64"); cb.callback64(timestamp, cb.data); } else if (cb.callback != nullptr) { ATRACE_FORMAT("AChoreographer_frameCallback"); cb.callback(timestamp, cb.data); } } Loading libs/gui/LayerState.cpp +15 −6 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ layer_state_t::layer_state_t() surfaceDamageRegion(), api(-1), colorTransform(mat4()), bgColorAlpha(0), bgColor(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false), shadowRadius(0.0f), Loading Loading @@ -140,7 +140,10 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeFloat, cornerRadius); SAFE_PARCEL(output.writeUint32, backgroundBlurRadius); SAFE_PARCEL(output.writeParcelable, metadata); SAFE_PARCEL(output.writeFloat, bgColorAlpha); SAFE_PARCEL(output.writeFloat, bgColor.r); SAFE_PARCEL(output.writeFloat, bgColor.g); SAFE_PARCEL(output.writeFloat, bgColor.b); SAFE_PARCEL(output.writeFloat, bgColor.a); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(bgColorDataspace)); SAFE_PARCEL(output.writeBool, colorSpaceAgnostic); SAFE_PARCEL(output.writeVectorSize, listeners); Loading Loading @@ -259,7 +262,14 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readUint32, &backgroundBlurRadius); SAFE_PARCEL(input.readParcelable, &metadata); SAFE_PARCEL(input.readFloat, &bgColorAlpha); SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.r = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.g = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.b = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.a = tmpFloat; SAFE_PARCEL(input.readUint32, &tmpUint32); bgColorDataspace = static_cast<ui::Dataspace>(tmpUint32); SAFE_PARCEL(input.readBool, &colorSpaceAgnostic); Loading Loading @@ -618,8 +628,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eBackgroundColorChanged) { what |= eBackgroundColorChanged; color.rgb = other.color.rgb; bgColorAlpha = other.bgColorAlpha; bgColor = other.bgColor; bgColorDataspace = other.bgColorDataspace; } if (other.what & eMetadataChanged) { Loading Loading @@ -752,7 +761,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF(diff, eColorTransformChanged, other, colorTransform); if (other.what & eHasListenerCallbacksChanged) diff |= eHasListenerCallbacksChanged; if (other.what & eInputInfoChanged) diff |= eInputInfoChanged; CHECK_DIFF3(diff, eBackgroundColorChanged, other, color.rgb, bgColorAlpha, bgColorDataspace); CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace); if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); CHECK_DIFF3(diff, eRenderBorderChanged, other, borderEnabled, borderWidth, borderColor); Loading libs/gui/SurfaceComposerClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1560,8 +1560,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBackg } s->what |= layer_state_t::eBackgroundColorChanged; s->color.rgb = color; s->bgColorAlpha = alpha; s->bgColor.rgb = color; s->bgColor.a = alpha; s->bgColorDataspace = dataspace; registerSurfaceControlForCallback(sc); Loading libs/gui/include/gui/LayerState.h +6 −7 Original line number Diff line number Diff line Loading @@ -226,9 +226,9 @@ struct layer_state_t { bool hasBufferChanges() const; // Layer hierarchy updates. static constexpr uint64_t HIERARCHY_CHANGES = layer_state_t::eBackgroundColorChanged | layer_state_t::eLayerChanged | layer_state_t::eRelativeLayerChanged | layer_state_t::eReparent; static constexpr uint64_t HIERARCHY_CHANGES = layer_state_t::eLayerChanged | layer_state_t::eRelativeLayerChanged | layer_state_t::eReparent | layer_state_t::eLayerStackChanged; // Geometry updates. static constexpr uint64_t GEOMETRY_CHANGES = layer_state_t::eBufferCropChanged | Loading Loading @@ -264,9 +264,8 @@ struct layer_state_t { static constexpr uint64_t AFFECTS_CHILDREN = layer_state_t::GEOMETRY_CHANGES | layer_state_t::HIERARCHY_CHANGES | layer_state_t::eAlphaChanged | layer_state_t::eColorTransformChanged | layer_state_t::eCornerRadiusChanged | layer_state_t::eFlagsChanged | layer_state_t::eLayerStackChanged | layer_state_t::eTrustedOverlayChanged | layer_state_t::eFrameRateChanged | layer_state_t::eFixedTransformHintChanged; layer_state_t::eFlagsChanged | layer_state_t::eTrustedOverlayChanged | layer_state_t::eFrameRateChanged | layer_state_t::eFixedTransformHintChanged; // Changes affecting data sent to input. static constexpr uint64_t INPUT_CHANGES = layer_state_t::GEOMETRY_CHANGES | Loading Loading @@ -333,7 +332,7 @@ struct layer_state_t { // The following refer to the alpha, and dataspace, respectively of // the background color layer float bgColorAlpha; half4 bgColor; ui::Dataspace bgColorDataspace; // A color space agnostic layer means the color of this layer can be Loading libs/renderengine/skia/SkiaVkRenderEngine.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -444,8 +444,11 @@ VulkanInterface initVulkanInterface(bool protectedContent = false) { ALOGD("Trying to create Vk device with protectedContent=%d (success)", protectedContent); VkQueue graphicsQueue; VK_GET_DEV_PROC(device, GetDeviceQueue); vkGetDeviceQueue(device, graphicsQueueIndex, 0, &graphicsQueue); VK_GET_DEV_PROC(device, GetDeviceQueue2); const VkDeviceQueueInfo2 deviceQueueInfo2 = {VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, nullptr, deviceQueueCreateFlags, (uint32_t)graphicsQueueIndex, 0}; vkGetDeviceQueue2(device, &deviceQueueInfo2, &graphicsQueue); VK_GET_DEV_PROC(device, DeviceWaitIdle); VK_GET_DEV_PROC(device, DestroyDevice); Loading Loading
libs/gui/Choreographer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ // #define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <gui/Choreographer.h> #include <gui/TraceUtils.h> #include <jni.h> #undef LOG_TAG Loading Loading @@ -297,6 +299,8 @@ void Choreographer::dispatchVsync(nsecs_t timestamp, PhysicalDisplayId, uint32_t mLastVsyncEventData = vsyncEventData; for (const auto& cb : callbacks) { if (cb.vsyncCallback != nullptr) { ATRACE_FORMAT("AChoreographer_vsyncCallback %" PRId64, vsyncEventData.preferredVsyncId()); const ChoreographerFrameCallbackDataImpl frameCallbackData = createFrameCallbackData(timestamp); registerStartTime(); Loading @@ -306,8 +310,10 @@ void Choreographer::dispatchVsync(nsecs_t timestamp, PhysicalDisplayId, uint32_t cb.data); mInCallback = false; } else if (cb.callback64 != nullptr) { ATRACE_FORMAT("AChoreographer_frameCallback64"); cb.callback64(timestamp, cb.data); } else if (cb.callback != nullptr) { ATRACE_FORMAT("AChoreographer_frameCallback"); cb.callback(timestamp, cb.data); } } Loading
libs/gui/LayerState.cpp +15 −6 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ layer_state_t::layer_state_t() surfaceDamageRegion(), api(-1), colorTransform(mat4()), bgColorAlpha(0), bgColor(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false), shadowRadius(0.0f), Loading Loading @@ -140,7 +140,10 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeFloat, cornerRadius); SAFE_PARCEL(output.writeUint32, backgroundBlurRadius); SAFE_PARCEL(output.writeParcelable, metadata); SAFE_PARCEL(output.writeFloat, bgColorAlpha); SAFE_PARCEL(output.writeFloat, bgColor.r); SAFE_PARCEL(output.writeFloat, bgColor.g); SAFE_PARCEL(output.writeFloat, bgColor.b); SAFE_PARCEL(output.writeFloat, bgColor.a); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(bgColorDataspace)); SAFE_PARCEL(output.writeBool, colorSpaceAgnostic); SAFE_PARCEL(output.writeVectorSize, listeners); Loading Loading @@ -259,7 +262,14 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readUint32, &backgroundBlurRadius); SAFE_PARCEL(input.readParcelable, &metadata); SAFE_PARCEL(input.readFloat, &bgColorAlpha); SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.r = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.g = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.b = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); bgColor.a = tmpFloat; SAFE_PARCEL(input.readUint32, &tmpUint32); bgColorDataspace = static_cast<ui::Dataspace>(tmpUint32); SAFE_PARCEL(input.readBool, &colorSpaceAgnostic); Loading Loading @@ -618,8 +628,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eBackgroundColorChanged) { what |= eBackgroundColorChanged; color.rgb = other.color.rgb; bgColorAlpha = other.bgColorAlpha; bgColor = other.bgColor; bgColorDataspace = other.bgColorDataspace; } if (other.what & eMetadataChanged) { Loading Loading @@ -752,7 +761,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF(diff, eColorTransformChanged, other, colorTransform); if (other.what & eHasListenerCallbacksChanged) diff |= eHasListenerCallbacksChanged; if (other.what & eInputInfoChanged) diff |= eInputInfoChanged; CHECK_DIFF3(diff, eBackgroundColorChanged, other, color.rgb, bgColorAlpha, bgColorDataspace); CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace); if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); CHECK_DIFF3(diff, eRenderBorderChanged, other, borderEnabled, borderWidth, borderColor); Loading
libs/gui/SurfaceComposerClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1560,8 +1560,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBackg } s->what |= layer_state_t::eBackgroundColorChanged; s->color.rgb = color; s->bgColorAlpha = alpha; s->bgColor.rgb = color; s->bgColor.a = alpha; s->bgColorDataspace = dataspace; registerSurfaceControlForCallback(sc); Loading
libs/gui/include/gui/LayerState.h +6 −7 Original line number Diff line number Diff line Loading @@ -226,9 +226,9 @@ struct layer_state_t { bool hasBufferChanges() const; // Layer hierarchy updates. static constexpr uint64_t HIERARCHY_CHANGES = layer_state_t::eBackgroundColorChanged | layer_state_t::eLayerChanged | layer_state_t::eRelativeLayerChanged | layer_state_t::eReparent; static constexpr uint64_t HIERARCHY_CHANGES = layer_state_t::eLayerChanged | layer_state_t::eRelativeLayerChanged | layer_state_t::eReparent | layer_state_t::eLayerStackChanged; // Geometry updates. static constexpr uint64_t GEOMETRY_CHANGES = layer_state_t::eBufferCropChanged | Loading Loading @@ -264,9 +264,8 @@ struct layer_state_t { static constexpr uint64_t AFFECTS_CHILDREN = layer_state_t::GEOMETRY_CHANGES | layer_state_t::HIERARCHY_CHANGES | layer_state_t::eAlphaChanged | layer_state_t::eColorTransformChanged | layer_state_t::eCornerRadiusChanged | layer_state_t::eFlagsChanged | layer_state_t::eLayerStackChanged | layer_state_t::eTrustedOverlayChanged | layer_state_t::eFrameRateChanged | layer_state_t::eFixedTransformHintChanged; layer_state_t::eFlagsChanged | layer_state_t::eTrustedOverlayChanged | layer_state_t::eFrameRateChanged | layer_state_t::eFixedTransformHintChanged; // Changes affecting data sent to input. static constexpr uint64_t INPUT_CHANGES = layer_state_t::GEOMETRY_CHANGES | Loading Loading @@ -333,7 +332,7 @@ struct layer_state_t { // The following refer to the alpha, and dataspace, respectively of // the background color layer float bgColorAlpha; half4 bgColor; ui::Dataspace bgColorDataspace; // A color space agnostic layer means the color of this layer can be Loading
libs/renderengine/skia/SkiaVkRenderEngine.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -444,8 +444,11 @@ VulkanInterface initVulkanInterface(bool protectedContent = false) { ALOGD("Trying to create Vk device with protectedContent=%d (success)", protectedContent); VkQueue graphicsQueue; VK_GET_DEV_PROC(device, GetDeviceQueue); vkGetDeviceQueue(device, graphicsQueueIndex, 0, &graphicsQueue); VK_GET_DEV_PROC(device, GetDeviceQueue2); const VkDeviceQueueInfo2 deviceQueueInfo2 = {VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, nullptr, deviceQueueCreateFlags, (uint32_t)graphicsQueueIndex, 0}; vkGetDeviceQueue2(device, &deviceQueueInfo2, &graphicsQueue); VK_GET_DEV_PROC(device, DeviceWaitIdle); VK_GET_DEV_PROC(device, DestroyDevice); Loading