OLD | NEW |
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 Loading... |
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 // Co-ordinates come in OpenGL co-ordinate space. |
347 // can do a partial swap to display. | 348 // We need to convert to layer space. |
348 window_->layer()->ScheduleDraw(); | 349 window_->SchedulePaintInRect(gfx::Rect( |
| 350 params.x, |
| 351 container->GetSize().height() - params.y - params.height, |
| 352 params.width, |
| 353 params.height)); |
349 | 354 |
350 // Add sending an ACK to the list of things to do OnCompositingEnded | 355 // Add sending an ACK to the list of things to do OnCompositingEnded |
351 on_compositing_ended_callbacks_.push_back( | 356 on_compositing_ended_callbacks_.push_back( |
352 base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer, | 357 base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer, |
353 params.route_id, gpu_host_id)); | 358 params.route_id, gpu_host_id)); |
354 ui::Compositor* compositor = window_->layer()->GetCompositor(); | 359 ui::Compositor* compositor = window_->layer()->GetCompositor(); |
355 if (!compositor->HasObserver(this)) | 360 if (!compositor->HasObserver(this)) |
356 compositor->AddObserver(this); | 361 compositor->AddObserver(this); |
357 } | 362 } |
358 #else | 363 #else |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 // static | 617 // static |
613 void RenderWidgetHostView::GetDefaultScreenInfo( | 618 void RenderWidgetHostView::GetDefaultScreenInfo( |
614 WebKit::WebScreenInfo* results) { | 619 WebKit::WebScreenInfo* results) { |
615 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); | 620 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); |
616 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 621 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
617 results->availableRect = results->rect; | 622 results->availableRect = results->rect; |
618 // TODO(derat): Don't hardcode this? | 623 // TODO(derat): Don't hardcode this? |
619 results->depth = 24; | 624 results->depth = 24; |
620 results->depthPerComponent = 8; | 625 results->depthPerComponent = 8; |
621 } | 626 } |
OLD | NEW |