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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "skia/ext/platform_canvas.h" | 62 #include "skia/ext/platform_canvas.h" |
63 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 63 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
64 #include "ui/events/event.h" | 64 #include "ui/events/event.h" |
65 #include "ui/events/keycodes/keyboard_codes.h" | 65 #include "ui/events/keycodes/keyboard_codes.h" |
66 #include "ui/gfx/size_conversions.h" | 66 #include "ui/gfx/size_conversions.h" |
67 #include "ui/gfx/skbitmap_operations.h" | 67 #include "ui/gfx/skbitmap_operations.h" |
68 #include "ui/gfx/vector2d_conversions.h" | 68 #include "ui/gfx/vector2d_conversions.h" |
69 #include "ui/snapshot/snapshot.h" | 69 #include "ui/snapshot/snapshot.h" |
70 #include "webkit/common/webpreferences.h" | 70 #include "webkit/common/webpreferences.h" |
71 | 71 |
72 #if defined(TOOLKIT_GTK) | 72 #if defined(OS_MACOSX) |
73 #include "content/browser/renderer_host/backing_store_gtk.h" | |
74 #elif defined(OS_MACOSX) | |
75 #include "content/browser/renderer_host/backing_store_mac.h" | 73 #include "content/browser/renderer_host/backing_store_mac.h" |
76 #elif defined(OS_WIN) | 74 #elif defined(OS_WIN) |
77 #include "content/common/plugin_constants_win.h" | 75 #include "content/common/plugin_constants_win.h" |
78 #endif | 76 #endif |
79 | 77 |
80 using base::Time; | 78 using base::Time; |
81 using base::TimeDelta; | 79 using base::TimeDelta; |
82 using base::TimeTicks; | 80 using base::TimeTicks; |
83 using blink::WebGestureEvent; | 81 using blink::WebGestureEvent; |
84 using blink::WebInputEvent; | 82 using blink::WebInputEvent; |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 if (view_) | 752 if (view_) |
755 view_->LockCompositingSurface(); | 753 view_->LockCompositingSurface(); |
756 } | 754 } |
757 | 755 |
758 void RenderWidgetHostImpl::UnlockBackingStore() { | 756 void RenderWidgetHostImpl::UnlockBackingStore() { |
759 if (view_) | 757 if (view_) |
760 view_->UnlockCompositingSurface(); | 758 view_->UnlockCompositingSurface(); |
761 } | 759 } |
762 #endif | 760 #endif |
763 | 761 |
764 #if defined(TOOLKIT_GTK) | 762 #if defined(OS_MACOSX) |
765 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow( | |
766 const gfx::Rect& dest_rect, GdkWindow* target) { | |
767 BackingStore* backing_store = GetBackingStore(false); | |
768 if (!backing_store) | |
769 return false; | |
770 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect( | |
771 dest_rect, target); | |
772 return true; | |
773 } | |
774 #elif defined(OS_MACOSX) | |
775 gfx::Size RenderWidgetHostImpl::GetBackingStoreSize() { | 763 gfx::Size RenderWidgetHostImpl::GetBackingStoreSize() { |
776 BackingStore* backing_store = GetBackingStore(false); | 764 BackingStore* backing_store = GetBackingStore(false); |
777 return backing_store ? backing_store->size() : gfx::Size(); | 765 return backing_store ? backing_store->size() : gfx::Size(); |
778 } | 766 } |
779 | 767 |
780 bool RenderWidgetHostImpl::CopyFromBackingStoreToCGContext( | 768 bool RenderWidgetHostImpl::CopyFromBackingStoreToCGContext( |
781 const CGRect& dest_rect, CGContextRef target) { | 769 const CGRect& dest_rect, CGContextRef target) { |
782 BackingStore* backing_store = GetBackingStore(false); | 770 BackingStore* backing_store = GetBackingStore(false); |
783 if (!backing_store) | 771 if (!backing_store) |
784 return false; | 772 return false; |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2565 } | 2553 } |
2566 } | 2554 } |
2567 | 2555 |
2568 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2556 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
2569 if (view_) | 2557 if (view_) |
2570 return view_->PreferredReadbackFormat(); | 2558 return view_->PreferredReadbackFormat(); |
2571 return SkBitmap::kARGB_8888_Config; | 2559 return SkBitmap::kARGB_8888_Config; |
2572 } | 2560 } |
2573 | 2561 |
2574 } // namespace content | 2562 } // namespace content |
OLD | NEW |