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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 "RenderWidgetHostImpl::CopyFromBackingStore::FromBackingStore"); | 741 "RenderWidgetHostImpl::CopyFromBackingStore::FromBackingStore"); |
742 gfx::Rect copy_rect = src_subrect.IsEmpty() ? | 742 gfx::Rect copy_rect = src_subrect.IsEmpty() ? |
743 gfx::Rect(backing_store->size()) : src_subrect; | 743 gfx::Rect(backing_store->size()) : src_subrect; |
744 // When the result size is equal to the backing store size, copy from the | 744 // When the result size is equal to the backing store size, copy from the |
745 // backing store directly to the output canvas. | 745 // backing store directly to the output canvas. |
746 skia::PlatformBitmap output; | 746 skia::PlatformBitmap output; |
747 bool result = backing_store->CopyFromBackingStore(copy_rect, &output); | 747 bool result = backing_store->CopyFromBackingStore(copy_rect, &output); |
748 callback.Run(result, output.GetBitmap()); | 748 callback.Run(result, output.GetBitmap()); |
749 } | 749 } |
750 | 750 |
751 bool RenderWidgetHostImpl::CanCopyFromBackingStore() { | |
752 if (view_) | |
753 view_->IsSurfaceAvailableForCopy(); | |
no sievers
2014/02/21 02:01:37
return view_->IsSurfaceAvailableForCopy();
powei
2014/02/21 02:27:22
Done. (oops)
| |
754 return false; | |
755 } | |
756 | |
757 void RenderWidgetHostImpl::LockForCopyFromBackingStore() { | |
758 if (view_) | |
759 view_->LockSurfaceForCopy(); | |
760 } | |
761 | |
762 void RenderWidgetHostImpl::UnlockForCopyFromBackingStore() { | |
763 if (view_) | |
764 view_->UnlockSurfaceForCopy(); | |
765 } | |
766 | |
751 #if defined(TOOLKIT_GTK) | 767 #if defined(TOOLKIT_GTK) |
752 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow( | 768 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow( |
753 const gfx::Rect& dest_rect, GdkWindow* target) { | 769 const gfx::Rect& dest_rect, GdkWindow* target) { |
754 BackingStore* backing_store = GetBackingStore(false); | 770 BackingStore* backing_store = GetBackingStore(false); |
755 if (!backing_store) | 771 if (!backing_store) |
756 return false; | 772 return false; |
757 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect( | 773 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect( |
758 dest_rect, target); | 774 dest_rect, target); |
759 return true; | 775 return true; |
760 } | 776 } |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2529 } | 2545 } |
2530 } | 2546 } |
2531 | 2547 |
2532 // Add newly generated components into the latency info | 2548 // Add newly generated components into the latency info |
2533 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2549 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
2534 latency_info->latency_components[lc->first] = lc->second; | 2550 latency_info->latency_components[lc->first] = lc->second; |
2535 } | 2551 } |
2536 } | 2552 } |
2537 | 2553 |
2538 } // namespace content | 2554 } // namespace content |
OLD | NEW |