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

Unified Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index c579d8c402912d65ad030226c553016b0d31a0ad..4e2874c053f8656f8903640aaef7480686aba412 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -19,7 +19,6 @@
#include "content/renderer/render_thread_impl.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "ipc/ipc_forwarding_message_filter.h"
#include "ipc/ipc_sync_channel.h"
namespace {
@@ -30,26 +29,6 @@ int g_prefer_smoothness_count = 0;
namespace content {
-//------------------------------------------------------------------------------
-
-// static
-IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
- base::TaskRunner* target_task_runner)
-{
- uint32 messages_to_filter[] = {
- ViewMsg_UpdateVSyncParameters::ID,
- ViewMsg_SwapCompositorFrameAck::ID,
- ViewMsg_ReclaimCompositorResources::ID,
-#if defined(OS_ANDROID)
- ViewMsg_BeginFrame::ID
-#endif
- };
-
- return new IPC::ForwardingMessageFilter(
- messages_to_filter, arraysize(messages_to_filter),
- target_task_runner);
-}
-
CompositorOutputSurface::CompositorOutputSurface(
int32 routing_id,
uint32 output_surface_id,
@@ -61,7 +40,7 @@ CompositorOutputSurface::CompositorOutputSurface(
output_surface_id_(output_surface_id),
use_swap_compositor_frame_message_(use_swap_compositor_frame_message),
output_surface_filter_(
- RenderThreadImpl::current()->compositor_output_surface_filter()),
+ RenderThreadImpl::current()->compositor_message_filter()),
frame_swap_message_queue_(swap_frame_message_queue),
routing_id_(routing_id),
prefers_smoothness_(false),
@@ -84,13 +63,14 @@ CompositorOutputSurface::CompositorOutputSurface(
CompositorOutputSurface::~CompositorOutputSurface() {
DCHECK(CalledOnValidThread());
- SetNeedsBeginFrame(false);
if (!HasClient())
return;
UpdateSmoothnessTakesPriority(false);
if (output_surface_proxy_.get())
output_surface_proxy_->ClearOutputSurface();
- output_surface_filter_->RemoveRoute(routing_id_);
+ output_surface_filter_->RemoveHandlerOnCompositorThread(
+ routing_id_,
+ output_surface_filter_handler_);
}
bool CompositorOutputSurface::BindToClient(
@@ -101,10 +81,12 @@ bool CompositorOutputSurface::BindToClient(
return false;
output_surface_proxy_ = new CompositorOutputSurfaceProxy(this);
- output_surface_filter_->AddRoute(
- routing_id_,
+ output_surface_filter_handler_ =
base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived,
- output_surface_proxy_));
+ output_surface_proxy_);
+ output_surface_filter_->AddHandlerOnCompositorThread(
+ routing_id_,
+ output_surface_filter_handler_);
if (!context_provider()) {
// Without a GPU context, the memory policy otherwise wouldn't be set.
@@ -193,9 +175,6 @@ void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
OnUpdateVSyncParametersFromBrowser);
IPC_MESSAGE_HANDLER(ViewMsg_SwapCompositorFrameAck, OnSwapAck);
IPC_MESSAGE_HANDLER(ViewMsg_ReclaimCompositorResources, OnReclaimResources);
-#if defined(OS_ANDROID)
- IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame);
-#endif
IPC_END_MESSAGE_MAP()
}
@@ -206,18 +185,6 @@ void CompositorOutputSurface::OnUpdateVSyncParametersFromBrowser(
CommitVSyncParameters(timebase, interval);
}
-#if defined(OS_ANDROID)
-void CompositorOutputSurface::SetNeedsBeginFrame(bool enable) {
- DCHECK(CalledOnValidThread());
- Send(new ViewHostMsg_SetNeedsBeginFrame(routing_id_, enable));
-}
-
-void CompositorOutputSurface::OnBeginFrame(const cc::BeginFrameArgs& args) {
- DCHECK(CalledOnValidThread());
- client_->BeginFrame(args);
-}
-#endif // defined(OS_ANDROID)
-
void CompositorOutputSurface::OnSwapAck(uint32 output_surface_id,
const cc::CompositorFrameAck& ack) {
// Ignore message if it's a stale one coming from a different output surface
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698