| 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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 const gfx::Rect& src_subrect, | 705 const gfx::Rect& src_subrect, |
| 706 const gfx::Size& accelerated_dst_size, | 706 const gfx::Size& accelerated_dst_size, |
| 707 const base::Callback<void(bool, const SkBitmap&)>& callback) { | 707 const base::Callback<void(bool, const SkBitmap&)>& callback) { |
| 708 if (view_ && is_accelerated_compositing_active_) { | 708 if (view_ && is_accelerated_compositing_active_) { |
| 709 TRACE_EVENT0("browser", | 709 TRACE_EVENT0("browser", |
| 710 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 710 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
| 711 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? | 711 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? |
| 712 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 712 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
| 713 view_->CopyFromCompositingSurface(accelerated_copy_rect, | 713 view_->CopyFromCompositingSurface(accelerated_copy_rect, |
| 714 accelerated_dst_size, | 714 accelerated_dst_size, |
| 715 callback); | 715 callback, |
| 716 false); |
| 716 return; | 717 return; |
| 717 } | 718 } |
| 718 | 719 |
| 719 BackingStore* backing_store = GetBackingStore(false); | 720 BackingStore* backing_store = GetBackingStore(false); |
| 720 if (!backing_store) { | 721 if (!backing_store) { |
| 721 callback.Run(false, SkBitmap()); | 722 callback.Run(false, SkBitmap()); |
| 722 return; | 723 return; |
| 723 } | 724 } |
| 724 | 725 |
| 725 TRACE_EVENT0("browser", | 726 TRACE_EVENT0("browser", |
| (...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2468 continue; | 2469 continue; |
| 2469 } | 2470 } |
| 2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 2471 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
| 2471 if (rwhi_set.insert(rwhi).second) | 2472 if (rwhi_set.insert(rwhi).second) |
| 2472 rwhi->FrameSwapped(latency_info); | 2473 rwhi->FrameSwapped(latency_info); |
| 2473 } | 2474 } |
| 2474 } | 2475 } |
| 2475 } | 2476 } |
| 2476 | 2477 |
| 2477 } // namespace content | 2478 } // namespace content |
| OLD | NEW |