Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1963263002: Fix Mac resize, delete more Mac code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index ca836d2a34305000da9445f3f4a3149fea4514a1..b7e7d96e5d842abfb9204a4e12be8c3b9378f834 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -75,6 +75,7 @@
#include "components/display_compositor/compositor_overlay_candidate_validator_mac.h"
#include "content/browser/compositor/software_output_device_mac.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
+#include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
#include "ui/base/cocoa/remote_layer_api.h"
#include "ui/base/ui_base_switches.h"
#elif defined(OS_ANDROID)
@@ -277,11 +278,6 @@ void GpuProcessTransportFactory::CreateOutputSurface(
if (!data) {
data = CreatePerCompositorData(compositor.get());
} else {
-#if defined(OS_MACOSX)
- // TODO(piman): Use GpuSurfaceTracker to map ids to surfaces instead of an
- // output_surface_map_ here.
- output_surface_map_.Remove(data->surface_handle);
-#endif
data->surface = nullptr;
}
@@ -396,6 +392,12 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
"125248"
" GpuProcessTransportFactory::EstablishedGpuChannel"
"::Compositor"));
+#if defined(OS_MACOSX)
+ // On Mac, GpuCommandBufferMsg_SwapBuffersCompleted must be handled in
+ // a nested message loop during resize.
+ context_provider->SetDefaultTaskRunner(
+ ui::WindowResizeHelperMac::Get()->task_runner());
+#endif
if (!context_provider->BindToCurrentThread())
context_provider = nullptr;
}
@@ -477,11 +479,6 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
}
}
-#if defined(OS_MACOSX)
- // TODO(piman): Use GpuSurfaceTracker to map ids to surfaces instead of an
- // output_surface_map_ here.
- output_surface_map_.AddWithID(surface.get(), data->surface_handle);
-#endif
data->surface = surface.get();
if (data->reflector)
data->reflector->OnSourceSurfaceReady(data->surface);
@@ -548,12 +545,6 @@ void GpuProcessTransportFactory::RemoveCompositor(ui::Compositor* compositor) {
return;
PerCompositorData* data = it->second;
DCHECK(data);
-#if defined(OS_MACOSX)
- // TODO(piman): Use GpuSurfaceTracker to map ids to surfaces instead of an
- // output_surface_map_ here.
- if (data->surface)
- output_surface_map_.Remove(data->surface_handle);
-#endif
#if !defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW)
if (data->surface_handle)
GpuSurfaceTracker::Get()->RemoveSurface(data->surface_handle);
@@ -680,16 +671,6 @@ void GpuProcessTransportFactory::SetCompositorSuspendedForRecycle(
if (data->surface)
data->surface->SetSurfaceSuspendedForRecycle(suspended);
}
-
-bool GpuProcessTransportFactory::
- SurfaceShouldNotShowFramesAfterSuspendForRecycle(
- gpu::SurfaceHandle surface_handle) const {
- BrowserCompositorOutputSurface* surface =
- output_surface_map_.Lookup(surface_handle);
- if (surface)
- return surface->SurfaceShouldNotShowFramesAfterSuspendForRecycle();
- return false;
-}
#endif
scoped_refptr<cc::ContextProvider>
« no previous file with comments | « content/browser/compositor/gpu_process_transport_factory.h ('k') | content/browser/compositor/image_transport_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698