diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/chromeos_camera | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/chromeos_camera')
7 files changed, 2 insertions, 189 deletions
diff --git a/chromium/components/chromeos_camera/BUILD.gn b/chromium/components/chromeos_camera/BUILD.gn index 045fab883cb..562adf84fec 100644 --- a/chromium/components/chromeos_camera/BUILD.gn +++ b/chromium/components/chromeos_camera/BUILD.gn @@ -189,19 +189,6 @@ if (use_v4l2_codec || use_vaapi) { } } -source_set("camera_app_helper") { - sources = [ - "camera_app_helper_impl.cc", - "camera_app_helper_impl.h", - ] - - deps = [ - "common:camera_app_helper", - "//ash/public/cpp", - "//ui/aura", - ] -} - test("jpeg_decode_accelerator_unittest") { deps = [ ":mjpeg_decode_accelerator", diff --git a/chromium/components/chromeos_camera/DEPS b/chromium/components/chromeos_camera/DEPS index ad030f9835c..995c9eba565 100644 --- a/chromium/components/chromeos_camera/DEPS +++ b/chromium/components/chromeos_camera/DEPS @@ -1,5 +1,4 @@ include_rules = [ - "+ash/public/cpp", "+media", "+mojo", "+third_party/libyuv", diff --git a/chromium/components/chromeos_camera/camera_app_helper_impl.cc b/chromium/components/chromeos_camera/camera_app_helper_impl.cc deleted file mode 100644 index cb4a5c803e0..00000000000 --- a/chromium/components/chromeos_camera/camera_app_helper_impl.cc +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/chromeos_camera/camera_app_helper_impl.h" - -#include <utility> - -#include "ash/public/cpp/tablet_mode.h" -#include "ash/public/cpp/window_properties.h" -#include "base/trace_event/trace_event.h" -#include "ui/aura/window.h" - -namespace chromeos_camera { - -CameraAppHelperImpl::CameraAppHelperImpl( - CameraResultCallback camera_result_callback, - aura::Window* window) - : camera_result_callback_(std::move(camera_result_callback)) { - DCHECK(window); - window->SetProperty(ash::kCanConsumeSystemKeysKey, true); - ash::TabletMode::Get()->AddObserver(this); -} - -CameraAppHelperImpl::~CameraAppHelperImpl() { - ash::TabletMode::Get()->RemoveObserver(this); -} - -void CameraAppHelperImpl::HandleCameraResult( - uint32_t intent_id, - arc::mojom::CameraIntentAction action, - const std::vector<uint8_t>& data, - HandleCameraResultCallback callback) { - camera_result_callback_.Run(intent_id, action, data, std::move(callback)); -} - -void CameraAppHelperImpl::IsTabletMode(IsTabletModeCallback callback) { - std::move(callback).Run(ash::TabletMode::Get()->InTabletMode()); -} - -void CameraAppHelperImpl::StartPerfEventTrace(const std::string& event) { - TRACE_EVENT_BEGIN0("camera", event.c_str()); -} - -void CameraAppHelperImpl::StopPerfEventTrace(const std::string& event) { - TRACE_EVENT_END0("camera", event.c_str()); -} - -void CameraAppHelperImpl::SetTabletMonitor( - mojo::PendingRemote<TabletModeMonitor> monitor, - SetTabletMonitorCallback callback) { - monitor_ = mojo::Remote<TabletModeMonitor>(std::move(monitor)); - std::move(callback).Run(ash::TabletMode::Get()->InTabletMode()); -} - -void CameraAppHelperImpl::OnTabletModeStarted() { - if (monitor_.is_bound()) - monitor_->Update(true); -} - -void CameraAppHelperImpl::OnTabletModeEnded() { - if (monitor_.is_bound()) - monitor_->Update(false); -} - -} // namespace chromeos_camera diff --git a/chromium/components/chromeos_camera/camera_app_helper_impl.h b/chromium/components/chromeos_camera/camera_app_helper_impl.h deleted file mode 100644 index b1b8f2c66a1..00000000000 --- a/chromium/components/chromeos_camera/camera_app_helper_impl.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_CHROMEOS_CAMERA_CAMERA_APP_HELPER_IMPL_H_ -#define COMPONENTS_CHROMEOS_CAMERA_CAMERA_APP_HELPER_IMPL_H_ - -#include <vector> - -#include "ash/public/cpp/tablet_mode_observer.h" -#include "base/macros.h" -#include "components/chromeos_camera/common/camera_app_helper.mojom.h" -#include "mojo/public/cpp/bindings/remote.h" - -namespace aura { -class Window; -} // namespace aura - -namespace chromeos_camera { - -class CameraAppHelperImpl : public ash::TabletModeObserver, - public mojom::CameraAppHelper { - public: - using CameraResultCallback = - base::RepeatingCallback<void(uint32_t, - arc::mojom::CameraIntentAction, - const std::vector<uint8_t>&, - HandleCameraResultCallback)>; - using TabletModeMonitor = mojom::TabletModeMonitor; - - CameraAppHelperImpl(CameraResultCallback camera_result_callback, - aura::Window* window); - ~CameraAppHelperImpl() override; - - // mojom::CameraAppHelper implementations. - void HandleCameraResult(uint32_t intent_id, - arc::mojom::CameraIntentAction action, - const std::vector<uint8_t>& data, - HandleCameraResultCallback callback) override; - void IsTabletMode(IsTabletModeCallback callback) override; - void StartPerfEventTrace(const std::string& event) override; - void StopPerfEventTrace(const std::string& event) override; - void SetTabletMonitor(mojo::PendingRemote<TabletModeMonitor> monitor, - SetTabletMonitorCallback callback) override; - - private: - // ash::TabletModeObserver overrides; - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; - - CameraResultCallback camera_result_callback_; - - mojo::Remote<TabletModeMonitor> monitor_; - - DISALLOW_COPY_AND_ASSIGN(CameraAppHelperImpl); -}; - -} // namespace chromeos_camera - -#endif // COMPONENTS_CHROMEOS_CAMERA_CAMERA_APP_HELPER_IMPL_H_ diff --git a/chromium/components/chromeos_camera/common/BUILD.gn b/chromium/components/chromeos_camera/common/BUILD.gn index 0385972a73c..d49f9e78888 100644 --- a/chromium/components/chromeos_camera/common/BUILD.gn +++ b/chromium/components/chromeos_camera/common/BUILD.gn @@ -17,8 +17,3 @@ mojom("common") { "//ui/gfx/geometry/mojom", ] } - -mojom("camera_app_helper") { - sources = [ "camera_app_helper.mojom" ] - deps = [ "//components/arc/mojom:camera_intent" ] -} diff --git a/chromium/components/chromeos_camera/common/camera_app_helper.mojom b/chromium/components/chromeos_camera/common/camera_app_helper.mojom deleted file mode 100644 index 7e6004cd438..00000000000 --- a/chromium/components/chromeos_camera/common/camera_app_helper.mojom +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module chromeos_camera.mojom; - -import "components/arc/mojom/camera_intent.mojom"; - -// Interface for monitoring tablet mode state of device. The state is detected -// from Chrome browser process and is notified to Chrome Camera App in renderer -// process. -interface TabletModeMonitor { - // Updates with the latest changed tablet mode state. - Update(bool is_tablet_mode); -}; - -// Interface for communication between Chrome Camera App (Remote) and Chrome -// (Receiver). -interface CameraAppHelper { - // Sends the captured result |data| for corresponding intent recognized by - // |intent_id| back to ARC. The handler should handle |data| and may notify - // the intent caller according to the intention of the |action|. |is_success| - // will be set to true if the ARC received the result and set to false for - // invalid input. - HandleCameraResult(uint32 intent_id, - arc.mojom.CameraIntentAction action, - array<uint8> data) => (bool is_success); - - // Checks if device is under tablet mode currently. - IsTabletMode() => (bool is_tablet_mode); - - // Triggers the begin of event tracing for given |event|. - StartPerfEventTrace(string event); - - // Triggers the end of event tracing for given |event|. - StopPerfEventTrace(string event); - - // Registers an TabletModeMonitor instance and returns the tablet mode - // initial state. Calling the Update() whenever the tablet mode state - // changes. - SetTabletMonitor(pending_remote<TabletModeMonitor> monitor) - => (bool is_tablet_mode); -}; diff --git a/chromium/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc b/chromium/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc index 6402b39d548..0c10c6901aa 100644 --- a/chromium/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc +++ b/chromium/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc @@ -644,7 +644,8 @@ void JpegClient::StartEncodeDmaBuf(int32_t bitstream_buffer_id) { auto input_buffer = gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( test_image->visible_size, gfx::BufferFormat::YUV_420_BIPLANAR, - gfx::BufferUsage::SCANOUT_CAMERA_READ_WRITE, gpu::kNullSurfaceHandle); + gfx::BufferUsage::SCANOUT_VEA_READ_CAMERA_AND_CPU_READ_WRITE, + gpu::kNullSurfaceHandle); ASSERT_EQ(input_buffer->Map(), true); uint8_t* plane_buf[2] = {static_cast<uint8_t*>(input_buffer->memory(0)), |