Loading libs/gui/LayerState.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -897,11 +897,11 @@ status_t CaptureArgs::writeToParcel(Parcel* output) const { SAFE_PARCEL(output->writeInt32, static_cast<int32_t>(dataspace)); SAFE_PARCEL(output->writeBool, allowProtected); SAFE_PARCEL(output->writeBool, grayscale); SAFE_PARCEL(output->writeInt32, excludeHandles.size()); for (auto& excludeHandle : excludeHandles) { SAFE_PARCEL(output->writeStrongBinder, excludeHandle); } SAFE_PARCEL(output->writeBool, hintForSeamlessTransition); return NO_ERROR; } Loading @@ -918,7 +918,6 @@ status_t CaptureArgs::readFromParcel(const Parcel* input) { dataspace = static_cast<ui::Dataspace>(value); SAFE_PARCEL(input->readBool, &allowProtected); SAFE_PARCEL(input->readBool, &grayscale); int32_t numExcludeHandles = 0; SAFE_PARCEL_READ_SIZE(input->readInt32, &numExcludeHandles, input->dataSize()); excludeHandles.reserve(numExcludeHandles); Loading @@ -927,6 +926,7 @@ status_t CaptureArgs::readFromParcel(const Parcel* input) { SAFE_PARCEL(input->readStrongBinder, &binder); excludeHandles.emplace(binder); } SAFE_PARCEL(input->readBool, &hintForSeamlessTransition); return NO_ERROR; } Loading libs/gui/aidl/android/gui/ISurfaceComposer.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,10 @@ interface ISurfaceComposer { */ void captureDisplay(in DisplayCaptureArgs args, IScreenCaptureListener listener); /** * Capture the specified screen. This requires the READ_FRAME_BUFFER * permission. */ void captureDisplayById(long displayId, IScreenCaptureListener listener); /** Loading libs/gui/include/gui/DisplayCaptureArgs.h +10 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ struct CaptureArgs : public Parcelable { bool captureSecureLayers{false}; int32_t uid{UNSET_UID}; // Force capture to be in a color space. If the value is ui::Dataspace::UNKNOWN, the captured // result will be in the display's colorspace. // result will be in a colorspace appropriate for capturing the display contents // The display may use non-RGB dataspace (ex. displayP3) that could cause pixel data could be // different from SRGB (byte per color), and failed when checking colors in tests. // NOTE: In normal cases, we want the screen to be captured in display's colorspace. Loading @@ -59,6 +59,15 @@ struct CaptureArgs : public Parcelable { std::unordered_set<sp<IBinder>, SpHash<IBinder>> excludeHandles; // Hint that the caller will use the screenshot animation as part of a transition animation. // The canonical example would be screen rotation - in such a case any color shift in the // screenshot is a detractor so composition in the display's colorspace is required. // Otherwise, the system may choose a colorspace that is more appropriate for use-cases // such as file encoding or for blending HDR content into an ap's UI, where the display's // exact colorspace is not an appropriate intermediate result. // Note that if the caller is requesting a specific dataspace, this hint does nothing. bool hintForSeamlessTransition = false; virtual status_t writeToParcel(Parcel* output) const; virtual status_t readFromParcel(const Parcel* input); }; Loading libs/renderengine/skia/AutoBackendTexture.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -43,10 +43,12 @@ AutoBackendTexture::AutoBackendTexture(GrDirectContext* context, AHardwareBuffer createProtectedImage, backendFormat, isOutputBuffer); mColorType = GrAHardwareBufferUtils::GetSkColorTypeFromBufferFormat(desc.format); ALOGE_IF(!mBackendTexture.isValid(), "Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d isWriteable:%d " "format:%d", this, desc.width, desc.height, createProtectedImage, isOutputBuffer, desc.format); if (!mBackendTexture.isValid() || !desc.width || !desc.height) { LOG_ALWAYS_FATAL("Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d " "isWriteable:%d format:%d", this, desc.width, desc.height, createProtectedImage, isOutputBuffer, desc.format); } } AutoBackendTexture::~AutoBackendTexture() { Loading libs/renderengine/skia/SkiaRenderEngine.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -517,16 +517,18 @@ sk_sp<SkShader> SkiaRenderEngine::createRuntimeEffectShader( } else { runtimeEffect = effectIter->second; } mat4 colorTransform = parameters.layer.colorTransform; colorTransform *= mat4::scale(vec4(parameters.layerDimmingRatio, parameters.layerDimmingRatio, parameters.layerDimmingRatio, 1.f)); const auto targetBuffer = parameters.layer.source.buffer.buffer; const auto graphicBuffer = targetBuffer ? targetBuffer->getBuffer() : nullptr; const auto hardwareBuffer = graphicBuffer ? graphicBuffer->toAHardwareBuffer() : nullptr; return createLinearEffectShader(parameters.shader, effect, runtimeEffect, colorTransform, parameters.display.maxLuminance, return createLinearEffectShader(parameters.shader, effect, runtimeEffect, std::move(colorTransform), parameters.display.maxLuminance, parameters.display.currentLuminanceNits, parameters.layer.source.buffer.maxLuminanceNits, hardwareBuffer, parameters.display.renderIntent); Loading Loading
libs/gui/LayerState.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -897,11 +897,11 @@ status_t CaptureArgs::writeToParcel(Parcel* output) const { SAFE_PARCEL(output->writeInt32, static_cast<int32_t>(dataspace)); SAFE_PARCEL(output->writeBool, allowProtected); SAFE_PARCEL(output->writeBool, grayscale); SAFE_PARCEL(output->writeInt32, excludeHandles.size()); for (auto& excludeHandle : excludeHandles) { SAFE_PARCEL(output->writeStrongBinder, excludeHandle); } SAFE_PARCEL(output->writeBool, hintForSeamlessTransition); return NO_ERROR; } Loading @@ -918,7 +918,6 @@ status_t CaptureArgs::readFromParcel(const Parcel* input) { dataspace = static_cast<ui::Dataspace>(value); SAFE_PARCEL(input->readBool, &allowProtected); SAFE_PARCEL(input->readBool, &grayscale); int32_t numExcludeHandles = 0; SAFE_PARCEL_READ_SIZE(input->readInt32, &numExcludeHandles, input->dataSize()); excludeHandles.reserve(numExcludeHandles); Loading @@ -927,6 +926,7 @@ status_t CaptureArgs::readFromParcel(const Parcel* input) { SAFE_PARCEL(input->readStrongBinder, &binder); excludeHandles.emplace(binder); } SAFE_PARCEL(input->readBool, &hintForSeamlessTransition); return NO_ERROR; } Loading
libs/gui/aidl/android/gui/ISurfaceComposer.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,10 @@ interface ISurfaceComposer { */ void captureDisplay(in DisplayCaptureArgs args, IScreenCaptureListener listener); /** * Capture the specified screen. This requires the READ_FRAME_BUFFER * permission. */ void captureDisplayById(long displayId, IScreenCaptureListener listener); /** Loading
libs/gui/include/gui/DisplayCaptureArgs.h +10 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ struct CaptureArgs : public Parcelable { bool captureSecureLayers{false}; int32_t uid{UNSET_UID}; // Force capture to be in a color space. If the value is ui::Dataspace::UNKNOWN, the captured // result will be in the display's colorspace. // result will be in a colorspace appropriate for capturing the display contents // The display may use non-RGB dataspace (ex. displayP3) that could cause pixel data could be // different from SRGB (byte per color), and failed when checking colors in tests. // NOTE: In normal cases, we want the screen to be captured in display's colorspace. Loading @@ -59,6 +59,15 @@ struct CaptureArgs : public Parcelable { std::unordered_set<sp<IBinder>, SpHash<IBinder>> excludeHandles; // Hint that the caller will use the screenshot animation as part of a transition animation. // The canonical example would be screen rotation - in such a case any color shift in the // screenshot is a detractor so composition in the display's colorspace is required. // Otherwise, the system may choose a colorspace that is more appropriate for use-cases // such as file encoding or for blending HDR content into an ap's UI, where the display's // exact colorspace is not an appropriate intermediate result. // Note that if the caller is requesting a specific dataspace, this hint does nothing. bool hintForSeamlessTransition = false; virtual status_t writeToParcel(Parcel* output) const; virtual status_t readFromParcel(const Parcel* input); }; Loading
libs/renderengine/skia/AutoBackendTexture.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -43,10 +43,12 @@ AutoBackendTexture::AutoBackendTexture(GrDirectContext* context, AHardwareBuffer createProtectedImage, backendFormat, isOutputBuffer); mColorType = GrAHardwareBufferUtils::GetSkColorTypeFromBufferFormat(desc.format); ALOGE_IF(!mBackendTexture.isValid(), "Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d isWriteable:%d " "format:%d", this, desc.width, desc.height, createProtectedImage, isOutputBuffer, desc.format); if (!mBackendTexture.isValid() || !desc.width || !desc.height) { LOG_ALWAYS_FATAL("Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d " "isWriteable:%d format:%d", this, desc.width, desc.height, createProtectedImage, isOutputBuffer, desc.format); } } AutoBackendTexture::~AutoBackendTexture() { Loading
libs/renderengine/skia/SkiaRenderEngine.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -517,16 +517,18 @@ sk_sp<SkShader> SkiaRenderEngine::createRuntimeEffectShader( } else { runtimeEffect = effectIter->second; } mat4 colorTransform = parameters.layer.colorTransform; colorTransform *= mat4::scale(vec4(parameters.layerDimmingRatio, parameters.layerDimmingRatio, parameters.layerDimmingRatio, 1.f)); const auto targetBuffer = parameters.layer.source.buffer.buffer; const auto graphicBuffer = targetBuffer ? targetBuffer->getBuffer() : nullptr; const auto hardwareBuffer = graphicBuffer ? graphicBuffer->toAHardwareBuffer() : nullptr; return createLinearEffectShader(parameters.shader, effect, runtimeEffect, colorTransform, parameters.display.maxLuminance, return createLinearEffectShader(parameters.shader, effect, runtimeEffect, std::move(colorTransform), parameters.display.maxLuminance, parameters.display.currentLuminanceNits, parameters.layer.source.buffer.maxLuminanceNits, hardwareBuffer, parameters.display.renderIntent); Loading