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

Unified Diff: content/browser/compositor/gpu_browser_compositor_output_surface.h

Issue 2402173002: cc: Get rid of PostSwapBuffersComplete. (Closed)
Patch Set: postswap: fix-blimp-unittest-post-swap-acks Created 4 years, 2 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_browser_compositor_output_surface.h
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.h b/content/browser/compositor/gpu_browser_compositor_output_surface.h
index 2642cc352c659ac1077651b308e8037d52f39b73..6f167e4a382326112489c96e23ba53594feafd1d 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.h
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.h
@@ -7,8 +7,8 @@
#include <memory>
-#include "base/cancelable_callback.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "content/browser/compositor/browser_compositor_output_surface.h"
#include "ui/gfx/swap_result.h"
@@ -43,13 +43,18 @@ class GpuBrowserCompositorOutputSurface
~GpuBrowserCompositorOutputSurface() override;
- protected:
- // BrowserCompositorOutputSurface:
- void OnReflectorChanged() override;
- void OnGpuSwapBuffersCompleted(
+ // Called when a swap completion is sent from the GPU process.
+ // The argument |params_mac| is used to communicate parameters needed on Mac
+ // to display the CALayer for the swap in the browser process.
+ // TODO(ccameron): Remove |params_mac| when the CALayer tree is hosted in the
+ // browser process.
+ virtual void OnGpuSwapBuffersCompleted(
const std::vector<ui::LatencyInfo>& latency_info,
gfx::SwapResult result,
- const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override;
+ const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac);
+
+ // BrowserCompositorOutputSurface implementation.
+ void OnReflectorChanged() override;
#if defined(OS_MACOSX)
void SetSurfaceSuspendedForRecycle(bool suspended) override;
#endif
@@ -69,18 +74,11 @@ class GpuBrowserCompositorOutputSurface
unsigned GetOverlayTextureId() const override;
bool SurfaceIsSuspendForRecycle() const override;
+ protected:
gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
- base::CancelableCallback<void(
- const std::vector<ui::LatencyInfo>&,
- gfx::SwapResult,
- const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac)>
- swap_buffers_completion_callback_;
- base::CancelableCallback<void(base::TimeTicks timebase,
- base::TimeDelta interval)>
- update_vsync_parameters_callback_;
-
std::unique_ptr<ReflectorTexture> reflector_texture_;
+ base::WeakPtrFactory<GpuBrowserCompositorOutputSurface> weak_ptr_factory_;
private:
DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface);

Powered by Google App Engine
This is Rietveld 408576698