Commit 0d012669 authored by kylechar's avatar kylechar Committed by Commit Bot

oopd: Delete win/mac code for VizDisplayCompositor disabled.

You can no longer no disable VizDisplayCompositor feature on Windows or
Mac so anything platform specific there is effectively dead code.

Bug: 936425
Change-Id: Iadc74ac6447f980929535bec7024ae754364aaf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602283Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659050}
parent 48561d50
...@@ -244,8 +244,8 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( ...@@ -244,8 +244,8 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
return std::make_unique<SoftwareOutputDevice>(); return std::make_unique<SoftwareOutputDevice>();
#if defined(OS_WIN) #if defined(OS_WIN)
return CreateSoftwareOutputDeviceWinGpu( return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
surface_handle, &output_device_backing_, display_client); display_client);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
return std::make_unique<SoftwareOutputDeviceMac>(task_runner_); return std::make_unique<SoftwareOutputDeviceMac>(task_runner_);
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
......
...@@ -170,62 +170,6 @@ void SoftwareOutputDeviceWinDirect::EndPaintDelegated( ...@@ -170,62 +170,6 @@ void SoftwareOutputDeviceWinDirect::EndPaintDelegated(
::ReleaseDC(hwnd(), hdc); ::ReleaseDC(hwnd(), hdc);
} }
// SoftwareOutputDevice implementation that uses layered window API to draw to
// the provided HWND.
class SoftwareOutputDeviceWinLayered : public SoftwareOutputDeviceWinBase {
public:
explicit SoftwareOutputDeviceWinLayered(HWND hwnd)
: SoftwareOutputDeviceWinBase(hwnd) {}
~SoftwareOutputDeviceWinLayered() override = default;
// SoftwareOutputDeviceWinBase implementation.
void ResizeDelegated() override;
SkCanvas* BeginPaintDelegated() override;
void EndPaintDelegated(const gfx::Rect& damage_rect) override;
private:
std::unique_ptr<SkCanvas> canvas_;
DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceWinLayered);
};
void SoftwareOutputDeviceWinLayered::ResizeDelegated() {
canvas_.reset();
}
SkCanvas* SoftwareOutputDeviceWinLayered::BeginPaintDelegated() {
if (!canvas_) {
// Layered windows can't share a pixel backing.
canvas_ = skia::CreatePlatformCanvasWithSharedSection(
viewport_pixel_size_.width(), viewport_pixel_size_.height(), true,
nullptr, skia::CRASH_ON_FAILURE);
}
return canvas_.get();
}
void SoftwareOutputDeviceWinLayered::EndPaintDelegated(
const gfx::Rect& damage_rect) {
if (!canvas_)
return;
// Set WS_EX_LAYERED extended window style if not already set.
DWORD style = GetWindowLong(hwnd(), GWL_EXSTYLE);
DCHECK(!(style & WS_EX_COMPOSITED));
if (!(style & WS_EX_LAYERED))
SetWindowLong(hwnd(), GWL_EXSTYLE, style | WS_EX_LAYERED);
RECT wr;
GetWindowRect(hwnd(), &wr);
SIZE size = {wr.right - wr.left, wr.bottom - wr.top};
POINT position = {wr.left, wr.top};
POINT zero = {0, 0};
BLENDFUNCTION blend = {AC_SRC_OVER, 0x00, 0xFF, AC_SRC_ALPHA};
HDC dib_dc = skia::GetNativeDrawingContext(canvas_.get());
UpdateLayeredWindow(hwnd(), nullptr, &position, &size, dib_dc, &zero,
RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA);
}
// SoftwareOutputDevice implementation that uses layered window API to draw // SoftwareOutputDevice implementation that uses layered window API to draw
// indirectly. Since UpdateLayeredWindow() is blocked by the GPU sandbox an // indirectly. Since UpdateLayeredWindow() is blocked by the GPU sandbox an
// implementation of mojom::LayeredWindowUpdater in the browser process handles // implementation of mojom::LayeredWindowUpdater in the browser process handles
...@@ -340,16 +284,7 @@ void SoftwareOutputDeviceWinProxy::DrawAck() { ...@@ -340,16 +284,7 @@ void SoftwareOutputDeviceWinProxy::DrawAck() {
} // namespace } // namespace
std::unique_ptr<SoftwareOutputDevice> CreateSoftwareOutputDeviceWinBrowser( std::unique_ptr<SoftwareOutputDevice> CreateSoftwareOutputDeviceWin(
HWND hwnd,
OutputDeviceBacking* backing) {
if (NeedsToUseLayerWindow(hwnd))
return std::make_unique<SoftwareOutputDeviceWinLayered>(hwnd);
return std::make_unique<SoftwareOutputDeviceWinDirect>(hwnd, backing);
}
std::unique_ptr<SoftwareOutputDevice> CreateSoftwareOutputDeviceWinGpu(
HWND hwnd, HWND hwnd,
OutputDeviceBacking* backing, OutputDeviceBacking* backing,
mojom::DisplayClient* display_client) { mojom::DisplayClient* display_client) {
......
...@@ -17,17 +17,11 @@ namespace viz { ...@@ -17,17 +17,11 @@ namespace viz {
class OutputDeviceBacking; class OutputDeviceBacking;
// Creates an appropriate SoftwareOutputDevice implementation for the browser // Creates an appropriate SoftwareOutputDevice implementation.
// process.
VIZ_SERVICE_EXPORT std::unique_ptr<SoftwareOutputDevice> VIZ_SERVICE_EXPORT std::unique_ptr<SoftwareOutputDevice>
CreateSoftwareOutputDeviceWinBrowser(HWND hwnd, OutputDeviceBacking* backing); CreateSoftwareOutputDeviceWin(HWND hwnd,
OutputDeviceBacking* backing,
// Creates an appropriate SoftwareOutputDevice implementation for the GPU mojom::DisplayClient* display_client);
// process.
VIZ_SERVICE_EXPORT std::unique_ptr<SoftwareOutputDevice>
CreateSoftwareOutputDeviceWinGpu(HWND hwnd,
OutputDeviceBacking* backing,
mojom::DisplayClient* display_client);
} // namespace viz } // namespace viz
......
...@@ -2604,8 +2604,6 @@ jumbo_source_set("browser") { ...@@ -2604,8 +2604,6 @@ jumbo_source_set("browser") {
"compositor/browser_compositor_output_surface.h", "compositor/browser_compositor_output_surface.h",
"compositor/gpu_browser_compositor_output_surface.cc", "compositor/gpu_browser_compositor_output_surface.cc",
"compositor/gpu_browser_compositor_output_surface.h", "compositor/gpu_browser_compositor_output_surface.h",
"compositor/gpu_output_surface_mac.cc",
"compositor/gpu_output_surface_mac.h",
"compositor/gpu_process_transport_factory.cc", "compositor/gpu_process_transport_factory.cc",
"compositor/gpu_process_transport_factory.h", "compositor/gpu_process_transport_factory.h",
"compositor/gpu_surfaceless_browser_compositor_output_surface.cc", "compositor/gpu_surfaceless_browser_compositor_output_surface.cc",
...@@ -2630,16 +2628,6 @@ jumbo_source_set("browser") { ...@@ -2630,16 +2628,6 @@ jumbo_source_set("browser") {
"renderer_host/delegated_frame_host.cc", "renderer_host/delegated_frame_host.cc",
"renderer_host/delegated_frame_host.h", "renderer_host/delegated_frame_host.h",
] ]
if (is_mac) {
jumbo_excluded_sources = [
# Both Mac SDK headers and third_party/khronos/GLES2/gl2ext.h
# declare macros GL_LINES_ADJACENCY_EXT, GL_LINE_STRIP_ADJACENCY_EXT,
# GL_TRIANGLES_ADJACENCY_EXT and GL_TRIANGLE_STRIP_ADJACENCY_EXT. They
# get the same values but with different formatting (0xD vs 0x000D).
# https://crbug.com/783666
"compositor/gpu_output_surface_mac.cc",
]
}
deps += [ deps += [
"//components/viz/service", "//components/viz/service",
"//ui/compositor", "//ui/compositor",
......
// Copyright 2016 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 "content/browser/compositor/gpu_output_surface_mac.h"
#include "components/viz/service/display/output_surface_client.h"
#include "components/viz/service/display/output_surface_frame.h"
#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "services/ws/public/cpp/gpu/context_provider_command_buffer.h"
namespace content {
GpuOutputSurfaceMac::GpuOutputSurfaceMac(
scoped_refptr<ws::ContextProviderCommandBuffer> context,
gpu::SurfaceHandle surface_handle,
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
overlay_candidate_validator,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager)
: GpuSurfacelessBrowserCompositorOutputSurface(
std::move(context),
surface_handle,
std::move(overlay_candidate_validator),
gfx::BufferFormat::RGBA_8888,
gpu_memory_buffer_manager) {}
GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {}
} // namespace content
// Copyright 2016 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 CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_
#define CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_
#include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h"
#include "ui/gfx/native_widget_types.h"
namespace content {
class GpuOutputSurfaceMac
: public GpuSurfacelessBrowserCompositorOutputSurface {
public:
GpuOutputSurfaceMac(scoped_refptr<ws::ContextProviderCommandBuffer> context,
gpu::SurfaceHandle surface_handle,
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
overlay_candidate_validator,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager);
~GpuOutputSurfaceMac() override;
private:
DISALLOW_COPY_AND_ASSIGN(GpuOutputSurfaceMac);
};
} // namespace content
#endif // CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_
...@@ -76,19 +76,7 @@ ...@@ -76,19 +76,7 @@
#include "ui/gfx/switches.h" #include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h" #include "ui/gl/gl_switches.h"
#if defined(USE_AURA) #if defined(USE_OZONE)
#include "content/public/common/service_manager_connection.h"
#include "ui/aura/env.h"
#include "ui/aura/window_tree_host.h"
#endif
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_win.h"
#include "components/viz/service/display_embedder/output_device_backing.h"
#include "components/viz/service/display_embedder/software_output_device_win.h"
#include "ui/gfx/win/rendering_window_manager.h"
#elif defined(USE_OZONE)
#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h" #include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_ozone.h"
#include "components/viz/service/display_embedder/software_output_device_ozone.h" #include "components/viz/service/display_embedder/software_output_device_ozone.h"
#include "ui/ozone/public/overlay_candidates_ozone.h" #include "ui/ozone/public/overlay_candidates_ozone.h"
...@@ -100,12 +88,6 @@ ...@@ -100,12 +88,6 @@
#include "ui/ozone/public/surface_ozone_canvas.h" #include "ui/ozone/public/surface_ozone_canvas.h"
#elif defined(USE_X11) #elif defined(USE_X11)
#include "components/viz/service/display_embedder/software_output_device_x11.h" #include "components/viz/service/display_embedder/software_output_device_x11.h"
#elif defined(OS_MACOSX)
#include "components/viz/service/display_embedder/compositor_overlay_candidate_validator_mac.h"
#include "components/viz/service/display_embedder/software_output_device_mac.h"
#include "content/browser/compositor/gpu_output_surface_mac.h"
#include "ui/base/cocoa/remote_layer_api.h"
#include "ui/base/ui_base_switches.h"
#endif #endif
#if !defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) #if !defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW)
#include "gpu/ipc/common/gpu_surface_tracker.h" #include "gpu/ipc/common/gpu_surface_tracker.h"
...@@ -131,13 +113,6 @@ constexpr char kIdentityUrl[] = ...@@ -131,13 +113,6 @@ constexpr char kIdentityUrl[] =
constexpr gpu::SchedulingPriority kStreamPriority = constexpr gpu::SchedulingPriority kStreamPriority =
content::kGpuStreamPriorityUI; content::kGpuStreamPriorityUI;
#if defined(OS_MACOSX)
bool IsCALayersDisabledFromCommandLine() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(switches::kDisableMacOverlays);
}
#endif
} // namespace } // namespace
namespace content { namespace content {
...@@ -187,9 +162,6 @@ GpuProcessTransportFactory::GpuProcessTransportFactory( ...@@ -187,9 +162,6 @@ GpuProcessTransportFactory::GpuProcessTransportFactory(
task_graph_runner_->Start("CompositorTileWorker1", task_graph_runner_->Start("CompositorTileWorker1",
base::SimpleThread::Options()); base::SimpleThread::Options());
#if defined(OS_WIN)
software_backing_ = std::make_unique<viz::OutputDeviceBacking>();
#endif
if (command_line->HasSwitch(switches::kDisableGpu) || if (command_line->HasSwitch(switches::kDisableGpu) ||
command_line->HasSwitch(switches::kDisableGpuCompositing)) { command_line->HasSwitch(switches::kDisableGpuCompositing)) {
...@@ -218,9 +190,7 @@ GpuProcessTransportFactory::CreateSoftwareOutputDevice( ...@@ -218,9 +190,7 @@ GpuProcessTransportFactory::CreateSoftwareOutputDevice(
return base::WrapUnique(new viz::SoftwareOutputDevice); return base::WrapUnique(new viz::SoftwareOutputDevice);
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if defined(OS_WIN) #if defined(USE_OZONE)
return CreateSoftwareOutputDeviceWinBrowser(widget, software_backing_.get());
#elif defined(USE_OZONE)
ui::SurfaceFactoryOzone* factory = ui::SurfaceFactoryOzone* factory =
ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone();
std::unique_ptr<ui::PlatformWindowSurface> platform_window_surface = std::unique_ptr<ui::PlatformWindowSurface> platform_window_surface =
...@@ -232,8 +202,6 @@ GpuProcessTransportFactory::CreateSoftwareOutputDevice( ...@@ -232,8 +202,6 @@ GpuProcessTransportFactory::CreateSoftwareOutputDevice(
std::move(platform_window_surface), std::move(surface_ozone)); std::move(platform_window_surface), std::move(surface_ozone));
#elif defined(USE_X11) #elif defined(USE_X11)
return std::make_unique<viz::SoftwareOutputDeviceX11>(widget); return std::make_unique<viz::SoftwareOutputDeviceX11>(widget);
#elif defined(OS_MACOSX)
return std::make_unique<viz::SoftwareOutputDeviceMac>(std::move(task_runner));
#else #else
NOTREACHED(); NOTREACHED();
return std::unique_ptr<viz::SoftwareOutputDevice>(); return std::unique_ptr<viz::SoftwareOutputDevice>();
...@@ -241,13 +209,7 @@ GpuProcessTransportFactory::CreateSoftwareOutputDevice( ...@@ -241,13 +209,7 @@ GpuProcessTransportFactory::CreateSoftwareOutputDevice(
} }
std::unique_ptr<viz::CompositorOverlayCandidateValidator> std::unique_ptr<viz::CompositorOverlayCandidateValidator>
CreateOverlayCandidateValidator( CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) {
#if defined(OS_MACOSX)
gfx::AcceleratedWidget widget,
bool disable_overlay_ca_layers) {
#else
gfx::AcceleratedWidget widget) {
#endif
std::unique_ptr<viz::CompositorOverlayCandidateValidator> validator; std::unique_ptr<viz::CompositorOverlayCandidateValidator> validator;
#if defined(USE_OZONE) #if defined(USE_OZONE)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
...@@ -269,18 +231,6 @@ CreateOverlayCandidateValidator( ...@@ -269,18 +231,6 @@ CreateOverlayCandidateValidator(
std::move(overlay_candidates), std::move(overlay_candidates),
viz::ParseOverlayStategies(enable_overlay_flag))); viz::ParseOverlayStategies(enable_overlay_flag)));
} }
#elif defined(OS_MACOSX)
// Overlays are only supported through the remote layer API.
if (ui::RemoteLayerAPISupported()) {
static bool overlays_disabled_at_command_line =
IsCALayersDisabledFromCommandLine();
const bool ca_layers_disabled =
overlays_disabled_at_command_line || disable_overlay_ca_layers;
validator.reset(
new viz::CompositorOverlayCandidateValidatorMac(ca_layers_disabled));
}
#elif defined(OS_WIN)
validator = std::make_unique<viz::CompositorOverlayCandidateValidatorWin>();
#endif #endif
return validator; return validator;
...@@ -299,11 +249,6 @@ void GpuProcessTransportFactory::CreateLayerTreeFrameSink( ...@@ -299,11 +249,6 @@ void GpuProcessTransportFactory::CreateLayerTreeFrameSink(
data->display_output_surface = nullptr; data->display_output_surface = nullptr;
} }
#if defined(OS_WIN)
gfx::RenderingWindowManager::GetInstance()->UnregisterParent(
compositor->widget());
#endif
const bool use_gpu_compositing = const bool use_gpu_compositing =
!compositor->force_software_compositor() && !is_gpu_compositing_disabled_; !compositor->force_software_compositor() && !is_gpu_compositing_disabled_;
if (use_gpu_compositing) { if (use_gpu_compositing) {
...@@ -350,11 +295,6 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( ...@@ -350,11 +295,6 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
support_stencil = true; support_stencil = true;
#endif #endif
#if defined(OS_WIN)
gfx::RenderingWindowManager::GetInstance()->RegisterParent(
compositor->widget());
#endif
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider; scoped_refptr<ws::ContextProviderCommandBuffer> context_provider;
if (!use_gpu_compositing) { if (!use_gpu_compositing) {
...@@ -455,16 +395,6 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( ...@@ -455,16 +395,6 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
context_provider, context_provider,
std::unique_ptr<viz::CompositorOverlayCandidateValidator>()); std::unique_ptr<viz::CompositorOverlayCandidateValidator>());
} else if (capabilities.surfaceless) { } else if (capabilities.surfaceless) {
#if defined(OS_MACOSX)
const auto& gpu_feature_info = context_provider->GetGpuFeatureInfo();
bool disable_overlay_ca_layers =
gpu_feature_info.IsWorkaroundEnabled(gpu::DISABLE_OVERLAY_CA_LAYERS);
display_output_surface = std::make_unique<GpuOutputSurfaceMac>(
context_provider, data->surface_handle,
CreateOverlayCandidateValidator(compositor->widget(),
disable_overlay_ca_layers),
GetGpuMemoryBufferManager());
#else
DCHECK(capabilities.texture_format_bgra8888); DCHECK(capabilities.texture_format_bgra8888);
auto gpu_output_surface = auto gpu_output_surface =
std::make_unique<GpuSurfacelessBrowserCompositorOutputSurface>( std::make_unique<GpuSurfacelessBrowserCompositorOutputSurface>(
...@@ -473,20 +403,9 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( ...@@ -473,20 +403,9 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
display::DisplaySnapshot::PrimaryFormat(), display::DisplaySnapshot::PrimaryFormat(),
GetGpuMemoryBufferManager()); GetGpuMemoryBufferManager());
display_output_surface = std::move(gpu_output_surface); display_output_surface = std::move(gpu_output_surface);
#endif
} else { } else {
std::unique_ptr<viz::CompositorOverlayCandidateValidator> validator; std::unique_ptr<viz::CompositorOverlayCandidateValidator> validator =
#if defined(OS_WIN) CreateOverlayCandidateValidator(compositor->widget());
const bool use_overlays_for_sw_protected_video =
base::FeatureList::IsEnabled(
features::kUseDCOverlaysForSoftwareProtectedVideo);
if (capabilities.dc_layers && (capabilities.use_dc_overlays_for_video ||
use_overlays_for_sw_protected_video))
validator = CreateOverlayCandidateValidator(compositor->widget());
#elif !defined(OS_MACOSX)
// Overlays are only supported on surfaceless output surfaces on Mac.
validator = CreateOverlayCandidateValidator(compositor->widget());
#endif
auto gpu_output_surface = auto gpu_output_surface =
std::make_unique<GpuBrowserCompositorOutputSurface>( std::make_unique<GpuBrowserCompositorOutputSurface>(
context_provider, std::move(validator)); context_provider, std::move(validator));
...@@ -684,10 +603,6 @@ void GpuProcessTransportFactory::RemoveCompositor(ui::Compositor* compositor) { ...@@ -684,10 +603,6 @@ void GpuProcessTransportFactory::RemoveCompositor(ui::Compositor* compositor) {
for (auto& observer : observer_list_) for (auto& observer : observer_list_)
observer.OnLostSharedContext(); observer.OnLostSharedContext();
} }
#if defined(OS_WIN)
gfx::RenderingWindowManager::GetInstance()->UnregisterParent(
compositor->widget());
#endif
} }
gpu::GpuMemoryBufferManager* gpu::GpuMemoryBufferManager*
......
...@@ -40,7 +40,6 @@ class GpuChannelEstablishFactory; ...@@ -40,7 +40,6 @@ class GpuChannelEstablishFactory;
namespace viz { namespace viz {
class CompositingModeReporterImpl; class CompositingModeReporterImpl;
class OutputDeviceBacking;
class RasterContextProvider; class RasterContextProvider;
class ServerSharedBitmapManager; class ServerSharedBitmapManager;
class SoftwareOutputDevice; class SoftwareOutputDevice;
...@@ -146,11 +145,6 @@ class GpuProcessTransportFactory : public ui::ContextFactory, ...@@ -146,11 +145,6 @@ class GpuProcessTransportFactory : public ui::ContextFactory,
viz::FrameSinkIdAllocator frame_sink_id_allocator_; viz::FrameSinkIdAllocator frame_sink_id_allocator_;
#if defined(OS_WIN)
// Used by output surface, stored in PerCompositorData.
std::unique_ptr<viz::OutputDeviceBacking> software_backing_;
#endif
// Depends on SurfaceManager. // Depends on SurfaceManager.
typedef std::map<ui::Compositor*, std::unique_ptr<PerCompositorData>> typedef std::map<ui::Compositor*, std::unique_ptr<PerCompositorData>>
PerCompositorDataMap; PerCompositorDataMap;
......
...@@ -493,9 +493,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac ...@@ -493,9 +493,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// Send updated vsync parameters to the top level display. // Send updated vsync parameters to the top level display.
void UpdateDisplayVSyncParameters(); void UpdateDisplayVSyncParameters();
// Adds/Removes frame observer based on state.
void UpdateNeedsBeginFramesInternal();
void SendSyntheticWheelEventWithPhaseEnded( void SendSyntheticWheelEventWithPhaseEnded(
blink::WebMouseWheelEvent wheel_event, blink::WebMouseWheelEvent wheel_event,
bool should_route_event); bool should_route_event);
...@@ -575,9 +572,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac ...@@ -575,9 +572,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// Display link for getting vsync info. // Display link for getting vsync info.
scoped_refptr<ui::DisplayLinkMac> display_link_; scoped_refptr<ui::DisplayLinkMac> display_link_;
// Whether a request for begin frames has been issued.
bool needs_begin_frames_;
// Whether or not the background is opaque as determined by calls to // Whether or not the background is opaque as determined by calls to
// SetBackgroundColor. The default value is opaque. // SetBackgroundColor. The default value is opaque.
bool background_is_opaque_ = true; bool background_is_opaque_ = true;
......
...@@ -87,7 +87,6 @@ void RenderWidgetHostViewMac::BrowserCompositorMacOnBeginFrame( ...@@ -87,7 +87,6 @@ void RenderWidgetHostViewMac::BrowserCompositorMacOnBeginFrame(
// ProgressFling must get called for middle click autoscroll fling on Mac. // ProgressFling must get called for middle click autoscroll fling on Mac.
if (host()) if (host())
host()->ProgressFlingIfNeeded(frame_time); host()->ProgressFlingIfNeeded(frame_time);
UpdateNeedsBeginFramesInternal();
} }
void RenderWidgetHostViewMac::OnFrameTokenChanged(uint32_t frame_token) { void RenderWidgetHostViewMac::OnFrameTokenChanged(uint32_t frame_token) {
...@@ -212,8 +211,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, ...@@ -212,8 +211,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
GetFrameSinkId(), this); GetFrameSinkId(), this);
} }
bool needs_begin_frames = true;
RenderWidgetHostOwnerDelegate* owner_delegate = host()->owner_delegate(); RenderWidgetHostOwnerDelegate* owner_delegate = host()->owner_delegate();
if (owner_delegate) { if (owner_delegate) {
// TODO(mostynb): actually use prefs. Landing this as a separate CL // TODO(mostynb): actually use prefs. Landing this as a separate CL
...@@ -221,29 +218,12 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, ...@@ -221,29 +218,12 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// NOTE: This will not be run for child frame widgets, which do not have // NOTE: This will not be run for child frame widgets, which do not have
// an owner delegate and won't get a RenderViewHost here. // an owner delegate and won't get a RenderViewHost here.
ignore_result(owner_delegate->GetWebkitPreferencesForWidget()); ignore_result(owner_delegate->GetWebkitPreferencesForWidget());
needs_begin_frames = !owner_delegate->IsNeverVisible();
} }
cursor_manager_.reset(new CursorManager(this)); cursor_manager_.reset(new CursorManager(this));
if (GetTextInputManager()) if (GetTextInputManager())
GetTextInputManager()->AddObserver(this); GetTextInputManager()->AddObserver(this);
// When Viz Display Compositor is not active, RenderWidgetHostViewMac is
// responsible for handling BeginFrames.
//
// Because of the way Mac pumps messages during resize, SetNeedsBeginFrame
// messages are not delayed on Mac. This leads to creation-time raciness
// where renderer sends a SetNeedsBeginFrame(true) before the renderer host is
// created to receive it.
//
// Any renderer that will produce frames needs to have begin frames sent to
// it. So unless it is never visible, start this value at true here to avoid
// startup raciness and decrease latency.
if (!features::IsVizDisplayCompositorEnabled()) {
needs_begin_frames_ = needs_begin_frames;
UpdateNeedsBeginFramesInternal();
}
} }
RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
...@@ -869,12 +849,7 @@ void RenderWidgetHostViewMac::EnsureSurfaceSynchronizedForWebTest() { ...@@ -869,12 +849,7 @@ void RenderWidgetHostViewMac::EnsureSurfaceSynchronizedForWebTest() {
} }
void RenderWidgetHostViewMac::SetNeedsBeginFrames(bool needs_begin_frames) { void RenderWidgetHostViewMac::SetNeedsBeginFrames(bool needs_begin_frames) {
needs_begin_frames_ = needs_begin_frames; NOTREACHED();
UpdateNeedsBeginFramesInternal();
}
void RenderWidgetHostViewMac::UpdateNeedsBeginFramesInternal() {
browser_compositor_->SetNeedsBeginFrames(needs_begin_frames_);
} }
void RenderWidgetHostViewMac::OnDidUpdateVisualPropertiesComplete( void RenderWidgetHostViewMac::OnDidUpdateVisualPropertiesComplete(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment