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_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 NOTIMPLEMENTED(); | 895 NOTIMPLEMENTED(); |
896 return static_cast<gfx::NativeViewAccessible>(NULL); | 896 return static_cast<gfx::NativeViewAccessible>(NULL); |
897 } | 897 } |
898 | 898 |
899 void RenderWidgetHostViewMac::MovePluginWindows( | 899 void RenderWidgetHostViewMac::MovePluginWindows( |
900 const gfx::Vector2d& scroll_offset, | 900 const gfx::Vector2d& scroll_offset, |
901 const std::vector<WebPluginGeometry>& moves) { | 901 const std::vector<WebPluginGeometry>& moves) { |
902 // Must be overridden, but unused on this platform. Core Animation | 902 // Must be overridden, but unused on this platform. Core Animation |
903 // plugins are drawn by the GPU process (through the compositor), | 903 // plugins are drawn by the GPU process (through the compositor), |
904 // and Core Graphics plugins are drawn by the renderer process. | 904 // and Core Graphics plugins are drawn by the renderer process. |
905 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 905 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
906 } | 906 } |
907 | 907 |
908 void RenderWidgetHostViewMac::Focus() { | 908 void RenderWidgetHostViewMac::Focus() { |
909 [[cocoa_view_ window] makeFirstResponder:cocoa_view_]; | 909 [[cocoa_view_ window] makeFirstResponder:cocoa_view_]; |
910 } | 910 } |
911 | 911 |
912 void RenderWidgetHostViewMac::Blur() { | 912 void RenderWidgetHostViewMac::Blur() { |
913 UnlockMouse(); | 913 UnlockMouse(); |
914 [[cocoa_view_ window] makeFirstResponder:nil]; | 914 [[cocoa_view_ window] makeFirstResponder:nil]; |
915 } | 915 } |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 composition_range_.start() + ui_actual_range.end()).ToNSRange(); | 1722 composition_range_.start() + ui_actual_range.end()).ToNSRange(); |
1723 } | 1723 } |
1724 return true; | 1724 return true; |
1725 } | 1725 } |
1726 | 1726 |
1727 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( | 1727 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( |
1728 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 1728 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
1729 int gpu_host_id) { | 1729 int gpu_host_id) { |
1730 TRACE_EVENT0("browser", | 1730 TRACE_EVENT0("browser", |
1731 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 1731 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
1732 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1732 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1733 | 1733 |
1734 AddPendingSwapAck(params.route_id, | 1734 AddPendingSwapAck(params.route_id, |
1735 gpu_host_id, | 1735 gpu_host_id, |
1736 compositing_iosurface_ ? | 1736 compositing_iosurface_ ? |
1737 compositing_iosurface_->GetRendererID() : 0); | 1737 compositing_iosurface_->GetRendererID() : 0); |
1738 CompositorSwapBuffers(params.surface_handle, | 1738 CompositorSwapBuffers(params.surface_handle, |
1739 params.size, | 1739 params.size, |
1740 params.scale_factor, | 1740 params.scale_factor, |
1741 params.latency_info); | 1741 params.latency_info); |
1742 } | 1742 } |
1743 | 1743 |
1744 void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( | 1744 void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( |
1745 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 1745 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
1746 int gpu_host_id) { | 1746 int gpu_host_id) { |
1747 TRACE_EVENT0("browser", | 1747 TRACE_EVENT0("browser", |
1748 "RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer"); | 1748 "RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer"); |
1749 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1749 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1750 | 1750 |
1751 AddPendingSwapAck(params.route_id, | 1751 AddPendingSwapAck(params.route_id, |
1752 gpu_host_id, | 1752 gpu_host_id, |
1753 compositing_iosurface_ ? | 1753 compositing_iosurface_ ? |
1754 compositing_iosurface_->GetRendererID() : 0); | 1754 compositing_iosurface_->GetRendererID() : 0); |
1755 CompositorSwapBuffers(params.surface_handle, | 1755 CompositorSwapBuffers(params.surface_handle, |
1756 params.surface_size, | 1756 params.surface_size, |
1757 params.surface_scale_factor, | 1757 params.surface_scale_factor, |
1758 params.latency_info); | 1758 params.latency_info); |
1759 } | 1759 } |
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4287 } | 4287 } |
4288 | 4288 |
4289 - (void)disableRendering { | 4289 - (void)disableRendering { |
4290 // Disable the fade-out animation as the layer is removed. | 4290 // Disable the fade-out animation as the layer is removed. |
4291 ScopedCAActionDisabler disabler; | 4291 ScopedCAActionDisabler disabler; |
4292 [self removeFromSuperlayer]; | 4292 [self removeFromSuperlayer]; |
4293 renderWidgetHostView_ = nil; | 4293 renderWidgetHostView_ = nil; |
4294 } | 4294 } |
4295 | 4295 |
4296 @end // implementation SoftwareLayer | 4296 @end // implementation SoftwareLayer |
OLD | NEW |