OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 Show(); | 276 Show(); |
277 Focus(); | 277 Focus(); |
278 } | 278 } |
279 | 279 |
280 RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const { | 280 RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const { |
281 return host_; | 281 return host_; |
282 } | 282 } |
283 | 283 |
284 void RenderWidgetHostViewAura::DidBecomeSelected() { | 284 void RenderWidgetHostViewAura::DidBecomeSelected() { |
285 host_->WasRestored(); | 285 host_->WasRestored(); |
| 286 if (!current_surface_ && host_->is_accelerated_compositing_active() && |
| 287 !released_front_lock_.get()) |
| 288 released_front_lock_ = window_->GetRootWindow()->GetCompositorLock(); |
286 } | 289 } |
287 | 290 |
288 void RenderWidgetHostViewAura::WasHidden() { | 291 void RenderWidgetHostViewAura::WasHidden() { |
289 host_->WasHidden(); | 292 host_->WasHidden(); |
| 293 released_front_lock_ = NULL; |
290 } | 294 } |
291 | 295 |
292 void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { | 296 void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { |
293 SetBounds(gfx::Rect(window_->bounds().origin(), size)); | 297 SetBounds(gfx::Rect(window_->bounds().origin(), size)); |
294 } | 298 } |
295 | 299 |
296 void RenderWidgetHostViewAura::SetBounds(const gfx::Rect& rect) { | 300 void RenderWidgetHostViewAura::SetBounds(const gfx::Rect& rect) { |
297 if (window_->bounds().size() != rect.size() && | 301 if (window_->bounds().size() != rect.size() && |
298 host_->is_accelerated_compositing_active()) { | 302 host_->is_accelerated_compositing_active()) { |
299 resize_locks_.push_back(make_linked_ptr( | 303 resize_locks_.push_back(make_linked_ptr( |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 needs_update_texture_ = false; | 506 needs_update_texture_ = false; |
503 if (current_surface_ != 0 && | 507 if (current_surface_ != 0 && |
504 host_->is_accelerated_compositing_active()) { | 508 host_->is_accelerated_compositing_active()) { |
505 | 509 |
506 ImageTransportClient* container = | 510 ImageTransportClient* container = |
507 image_transport_clients_[current_surface_]; | 511 image_transport_clients_[current_surface_]; |
508 if (container) | 512 if (container) |
509 container->Update(); | 513 container->Update(); |
510 window_->SetExternalTexture(container); | 514 window_->SetExternalTexture(container); |
511 | 515 |
| 516 released_front_lock_ = NULL; |
| 517 |
512 if (!container) { | 518 if (!container) { |
513 resize_locks_.clear(); | 519 resize_locks_.clear(); |
514 } else { | 520 } else { |
515 typedef std::vector<linked_ptr<ResizeLock> > ResizeLockList; | 521 typedef std::vector<linked_ptr<ResizeLock> > ResizeLockList; |
516 ResizeLockList::iterator it = resize_locks_.begin(); | 522 ResizeLockList::iterator it = resize_locks_.begin(); |
517 while (it != resize_locks_.end()) { | 523 while (it != resize_locks_.end()) { |
518 gfx::Size container_size = content::ConvertSizeToDIP(this, | 524 gfx::Size container_size = content::ConvertSizeToDIP(this, |
519 container->size()); | 525 container->size()); |
520 if ((*it)->expected_size() == container_size) | 526 if ((*it)->expected_size() == container_size) |
521 break; | 527 break; |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1350 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1345 RenderWidgetHost* widget) { | 1351 RenderWidgetHost* widget) { |
1346 return new RenderWidgetHostViewAura(widget); | 1352 return new RenderWidgetHostViewAura(widget); |
1347 } | 1353 } |
1348 | 1354 |
1349 // static | 1355 // static |
1350 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1356 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1351 WebKit::WebScreenInfo* results) { | 1357 WebKit::WebScreenInfo* results) { |
1352 GetScreenInfoForWindow(results, NULL); | 1358 GetScreenInfoForWindow(results, NULL); |
1353 } | 1359 } |
OLD | NEW |