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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 11861020: Aura: Browser-side changes for Composite-To-Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 2716c2e3aede353d7cd0323018feffd07ef4dc29..011cb36c888e021b87965aec9c4bb0a516143ede 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -17,7 +17,7 @@
#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
-#include "cc/compositor_frame.h"
+#include "cc/switches.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
@@ -1527,6 +1527,8 @@ void RenderWidgetHostImpl::OnSwapCompositorFrame(
frame.metadata.location_bar_content_translation);
}
#endif
+ if (view_)
+ view_->OnSwapCompositorFrame(frame, process_->GetID(), routing_id_);
}
void RenderWidgetHostImpl::OnUpdateRect(
@@ -2324,6 +2326,22 @@ bool RenderWidgetHostImpl::GotResponseToLockMouseRequest(bool allowed) {
void RenderWidgetHostImpl::AcknowledgeBufferPresent(
int32 route_id, int gpu_host_id,
const AcceleratedSurfaceMsg_BufferPresented_Params& params) {
+ static bool composite_to_mailbox =
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ cc::switches::kCompositeToMailbox);
piman 2013/01/18 02:14:11 This is a bit of a hack. At the call site, dependi
no sievers 2013/02/06 23:36:00 Note that the method needs to be static though. Bu
+
+ if (composite_to_mailbox) {
+ // We will return the texture to the renderer.
+ cc::CompositorFrameAck ack;
+ std::copy(params.mailbox_name.data(),
+ params.mailbox_name.data() + params.mailbox_name.length(),
+ reinterpret_cast<char*>(ack.mailbox.name));
+ ack.sync_point = params.sync_point;
+ RenderProcessHost* host = RenderProcessHost::FromID(gpu_host_id);
+ host->Send(new ViewMsg_SwapCompositorFrameAck(route_id, ack));
+ return;
+ }
+
GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);
if (ui_shim) {
ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id,

Powered by Google App Engine
This is Rietveld 408576698