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

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

Issue 16730003: Aura: Support --enable-partial-swap with --composite-to-mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 7 years, 6 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 30d1fb79d8b6b9d09a9add8950f41a2189526e55..5a46365affee47d602783e394458ca6c54f3a4a7 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1616,11 +1616,12 @@ void RenderWidgetHostViewAura::OnSwapCompositorFrame(
std::string mailbox_name(
reinterpret_cast<const char*>(frame->gl_frame_data->mailbox.name),
sizeof(frame->gl_frame_data->mailbox.name));
- BuffersSwapped(frame->gl_frame_data->size,
- frame->metadata.device_scale_factor,
- mailbox_name,
- frame->metadata.latency_info,
- ack_callback);
+ SubBufferPosted(frame->gl_frame_data->size,
+ frame->metadata.device_scale_factor,
+ mailbox_name,
+ frame->metadata.latency_info,
+ frame->gl_frame_data->damage_rect,
+ ack_callback);
}
#if defined(OS_WIN)
@@ -1662,23 +1663,21 @@ void RenderWidgetHostViewAura::BuffersSwapped(
SwapBuffersCompleted(ack_callback, texture_to_return);
}
-void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
- const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,
- int gpu_host_id) {
+void RenderWidgetHostViewAura::SubBufferPosted(
+ const gfx::Size& size,
no sievers 2013/06/10 18:28:59 nit: 'size' -> 'surface_size'
jonathan.backer 2013/06/10 19:11:13 Done.
+ float surface_scale_factor,
+ const std::string& mailbox_name,
+ const ui::LatencyInfo& latency_info,
+ const gfx::Rect& damage_rect,
+ const BufferPresentedCallback& ack_callback) {
scoped_refptr<ui::Texture> previous_texture(current_surface_);
- const gfx::Rect surface_rect =
- gfx::Rect(params_in_pixel.surface_size);
- gfx::Rect damage_rect(params_in_pixel.x,
- params_in_pixel.y,
- params_in_pixel.width,
- params_in_pixel.height);
- BufferPresentedCallback ack_callback = base::Bind(
- &AcknowledgeBufferForGpu, params_in_pixel.route_id, gpu_host_id,
- params_in_pixel.mailbox_name);
+ const gfx::Rect surface_rect = gfx::Rect(size);
- if (!SwapBuffersPrepare(
- surface_rect, params_in_pixel.surface_scale_factor, damage_rect,
- params_in_pixel.mailbox_name, ack_callback)) {
+ if (!SwapBuffersPrepare(surface_rect,
+ surface_scale_factor,
+ damage_rect,
+ mailbox_name,
+ ack_callback)) {
return;
}
@@ -1691,7 +1690,7 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
DCHECK(surface_rect.Contains(SkIRectToRect(damage.getBounds())));
ui::Texture* current_texture = current_surface_.get();
- const gfx::Size surface_size_in_pixel = params_in_pixel.surface_size;
+ const gfx::Size surface_size_in_pixel = size;
DLOG_IF(ERROR, previous_texture &&
previous_texture->size() != current_texture->size() &&
SkIRectToRect(damage.getBounds()) != surface_rect) <<
@@ -1712,13 +1711,13 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
if (compositor) {
// Co-ordinates come in OpenGL co-ordinate space.
// We need to convert to layer space.
- gfx::Rect rect_to_paint = ConvertRectToDIP(
- params_in_pixel.surface_scale_factor,
- gfx::Rect(params_in_pixel.x,
- surface_size_in_pixel.height() - params_in_pixel.y -
- params_in_pixel.height,
- params_in_pixel.width,
- params_in_pixel.height));
+ gfx::Rect rect_to_paint =
+ ConvertRectToDIP(surface_scale_factor,
+ gfx::Rect(damage_rect.x(),
+ surface_size_in_pixel.height() -
+ damage_rect.y() - damage_rect.height(),
+ damage_rect.width(),
+ damage_rect.height()));
// Damage may not have been DIP aligned, so inflate damage to compensate
// for any round-off error.
@@ -1728,12 +1727,32 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
if (paint_observer_)
paint_observer_->OnUpdateCompositorContent();
window_->SchedulePaintInRect(rect_to_paint);
- compositor->SetLatencyInfo(params_in_pixel.latency_info);
+ compositor->SetLatencyInfo(latency_info);
}
SwapBuffersCompleted(ack_callback, previous_texture);
}
+void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
+ const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,
+ int gpu_host_id) {
+ gfx::Rect damage_rect(params_in_pixel.x,
+ params_in_pixel.y,
+ params_in_pixel.width,
+ params_in_pixel.height);
+ BufferPresentedCallback ack_callback =
+ base::Bind(&AcknowledgeBufferForGpu,
+ params_in_pixel.route_id,
+ gpu_host_id,
+ params_in_pixel.mailbox_name);
+ SubBufferPosted(params_in_pixel.surface_size,
+ params_in_pixel.surface_scale_factor,
+ params_in_pixel.mailbox_name,
+ params_in_pixel.latency_info,
+ damage_rect,
+ ack_callback);
+}
+
void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() {
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698