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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 } | 357 } |
358 #else | 358 #else |
359 NOTREACHED(); | 359 NOTREACHED(); |
360 #endif | 360 #endif |
361 } | 361 } |
362 | 362 |
363 void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( | 363 void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( |
364 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 364 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
365 int gpu_host_id) { | 365 int gpu_host_id) { |
366 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 366 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
367 window_->layer()->SetExternalTexture( | 367 scoped_refptr<AcceleratedSurfaceContainerLinux> container = |
368 accelerated_surface_containers_[params.surface_id]->GetTexture()); | 368 accelerated_surface_containers_[params.surface_id]; |
369 window_->layer()->SetExternalTexture(container->GetTexture()); | |
369 glFlush(); | 370 glFlush(); |
370 | 371 |
371 if (!window_->layer()->GetCompositor()) { | 372 if (!window_->layer()->GetCompositor()) { |
372 // We have no compositor, so we have no way to display the surface | 373 // We have no compositor, so we have no way to display the surface |
373 // Must still send the ACK | 374 // Must still send the ACK |
374 RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id); | 375 RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id); |
375 } else { | 376 } else { |
376 // TODO(backer): Plumb the damage rect to the ui compositor so that we | 377 #if defined(USE_WEBKIT_COMPOSITOR) |
377 // can do a partial swap to display. | 378 // Co-ords come in GL co-ord space. Need to convert to layer space. |
sky
2011/12/08 17:39:05
I've never seen coordinates abbreviated like that.
jonathan.backer
2011/12/08 18:41:44
Done.
| |
379 window_->layer()->SchedulePaint(gfx::Rect( | |
sky
2011/12/08 17:39:05
nit: window_->SchedulePaint should work equally we
jonathan.backer
2011/12/08 18:41:44
Done.
| |
380 params.x, | |
381 container->GetSize().height() - params.y - params.height, | |
382 params.width, | |
383 params.height)); | |
384 #else | |
378 window_->layer()->ScheduleDraw(); | 385 window_->layer()->ScheduleDraw(); |
386 #endif | |
379 | 387 |
380 // Add sending an ACK to the list of things to do OnCompositingEnded | 388 // Add sending an ACK to the list of things to do OnCompositingEnded |
381 on_compositing_ended_callbacks_.push_back( | 389 on_compositing_ended_callbacks_.push_back( |
382 base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer, | 390 base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer, |
383 params.route_id, gpu_host_id)); | 391 params.route_id, gpu_host_id)); |
384 ui::Compositor* compositor = window_->layer()->GetCompositor(); | 392 ui::Compositor* compositor = window_->layer()->GetCompositor(); |
385 if (!compositor->HasObserver(this)) | 393 if (!compositor->HasObserver(this)) |
386 compositor->AddObserver(this); | 394 compositor->AddObserver(this); |
387 } | 395 } |
388 #else | 396 #else |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
835 results->availableRect = results->rect; | 843 results->availableRect = results->rect; |
836 // TODO(derat): Don't hardcode this? | 844 // TODO(derat): Don't hardcode this? |
837 results->depth = 24; | 845 results->depth = 24; |
838 results->depthPerComponent = 8; | 846 results->depthPerComponent = 8; |
839 } | 847 } |
840 | 848 |
841 ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() { | 849 ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() { |
842 aura::Desktop* desktop = aura::Desktop::GetInstance(); | 850 aura::Desktop* desktop = aura::Desktop::GetInstance(); |
843 return desktop->GetInputMethod(); | 851 return desktop->GetInputMethod(); |
844 } | 852 } |
OLD | NEW |