| 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 const gfx::Rect& src_subrect, | 717 const gfx::Rect& src_subrect, |
| 718 const gfx::Size& accelerated_dst_size, | 718 const gfx::Size& accelerated_dst_size, |
| 719 const base::Callback<void(bool, const SkBitmap&)>& callback) { | 719 const base::Callback<void(bool, const SkBitmap&)>& callback) { |
| 720 if (view_ && is_accelerated_compositing_active_) { | 720 if (view_ && is_accelerated_compositing_active_) { |
| 721 TRACE_EVENT0("browser", | 721 TRACE_EVENT0("browser", |
| 722 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 722 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
| 723 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? | 723 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? |
| 724 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 724 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
| 725 view_->CopyFromCompositingSurface(accelerated_copy_rect, | 725 view_->CopyFromCompositingSurface(accelerated_copy_rect, |
| 726 accelerated_dst_size, | 726 accelerated_dst_size, |
| 727 callback); | 727 callback, |
| 728 false); |
| 728 return; | 729 return; |
| 729 } | 730 } |
| 730 | 731 |
| 731 BackingStore* backing_store = GetBackingStore(false); | 732 BackingStore* backing_store = GetBackingStore(false); |
| 732 if (!backing_store) { | 733 if (!backing_store) { |
| 733 callback.Run(false, SkBitmap()); | 734 callback.Run(false, SkBitmap()); |
| 734 return; | 735 return; |
| 735 } | 736 } |
| 736 | 737 |
| 737 TRACE_EVENT0("browser", | 738 TRACE_EVENT0("browser", |
| (...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 } | 2513 } |
| 2513 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 2514 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
| 2514 if (rwhi_set.insert(rwhi).second) | 2515 if (rwhi_set.insert(rwhi).second) |
| 2515 rwhi->FrameSwapped(latency_info[i]); | 2516 rwhi->FrameSwapped(latency_info[i]); |
| 2516 } | 2517 } |
| 2517 } | 2518 } |
| 2518 } | 2519 } |
| 2519 } | 2520 } |
| 2520 | 2521 |
| 2521 } // namespace content | 2522 } // namespace content |
| OLD | NEW |