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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 8764001: Plumb damage rect to browser compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/renderer_host/backing_store_skia.h" 8 #include "content/browser/renderer_host/backing_store_skia.h"
9 #include "content/browser/renderer_host/render_widget_host.h" 9 #include "content/browser/renderer_host/render_widget_host.h"
10 #include "content/browser/renderer_host/web_input_event_aura.h" 10 #include "content/browser/renderer_host/web_input_event_aura.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 327 }
328 #else 328 #else
329 NOTREACHED(); 329 NOTREACHED();
330 #endif 330 #endif
331 } 331 }
332 332
333 void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( 333 void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
334 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, 334 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
335 int gpu_host_id) { 335 int gpu_host_id) {
336 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) 336 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
337 window_->layer()->SetExternalTexture( 337 scoped_refptr<AcceleratedSurfaceContainerLinux> container =
338 accelerated_surface_containers_[params.surface_id]->GetTexture()); 338 accelerated_surface_containers_[params.surface_id];
339 window_->layer()->SetExternalTexture(container->GetTexture());
339 glFlush(); 340 glFlush();
340 341
341 if (!window_->layer()->GetCompositor()) { 342 if (!window_->layer()->GetCompositor()) {
342 // We have no compositor, so we have no way to display the surface 343 // We have no compositor, so we have no way to display the surface
343 // Must still send the ACK 344 // Must still send the ACK
344 RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id); 345 RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id);
345 } else { 346 } else {
346 // TODO(backer): Plumb the damage rect to the ui compositor so that we 347 #if defined(USE_WEBKIT_COMPOSITOR)
347 // can do a partial swap to display. 348 // Co-ords come in GL co-ord space. Need to convert to layer space.
349 window_->layer()->SchedulePaint(gfx::Rect(
350 params.x,
351 container->GetSize().height() - params.y - params.height,
apatrick_chromium 2011/12/06 01:10:30 It looks like a lot of this function is reaching i
jonathan.backer 2011/12/06 01:25:12 I'm asking for the layer for a paint in it's co-or
352 params.width,
353 params.height));
354 #else
348 window_->layer()->ScheduleDraw(); 355 window_->layer()->ScheduleDraw();
356 #endif
349 357
350 // Add sending an ACK to the list of things to do OnCompositingEnded 358 // Add sending an ACK to the list of things to do OnCompositingEnded
351 on_compositing_ended_callbacks_.push_back( 359 on_compositing_ended_callbacks_.push_back(
352 base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer, 360 base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer,
353 params.route_id, gpu_host_id)); 361 params.route_id, gpu_host_id));
354 ui::Compositor* compositor = window_->layer()->GetCompositor(); 362 ui::Compositor* compositor = window_->layer()->GetCompositor();
355 if (!compositor->HasObserver(this)) 363 if (!compositor->HasObserver(this))
356 compositor->AddObserver(this); 364 compositor->AddObserver(this);
357 } 365 }
358 #else 366 #else
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 // static 620 // static
613 void RenderWidgetHostView::GetDefaultScreenInfo( 621 void RenderWidgetHostView::GetDefaultScreenInfo(
614 WebKit::WebScreenInfo* results) { 622 WebKit::WebScreenInfo* results) {
615 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); 623 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize();
616 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); 624 results->rect = WebKit::WebRect(0, 0, size.width(), size.height());
617 results->availableRect = results->rect; 625 results->availableRect = results->rect;
618 // TODO(derat): Don't hardcode this? 626 // TODO(derat): Don't hardcode this?
619 results->depth = 24; 627 results->depth = 24;
620 results->depthPerComponent = 8; 628 results->depthPerComponent = 8;
621 } 629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698