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