| 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 <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
| 9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
| 10 | 10 |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 bool RenderWidgetHostViewMac::IsPopup() const { | 1240 bool RenderWidgetHostViewMac::IsPopup() const { |
| 1241 return popup_type_ != blink::WebPopupTypeNone; | 1241 return popup_type_ != blink::WebPopupTypeNone; |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 void RenderWidgetHostViewMac::CopyFromCompositingSurface( | 1244 void RenderWidgetHostViewMac::CopyFromCompositingSurface( |
| 1245 const gfx::Rect& src_subrect, | 1245 const gfx::Rect& src_subrect, |
| 1246 const gfx::Size& dst_size, | 1246 const gfx::Size& dst_size, |
| 1247 ReadbackRequestCallback& callback, | 1247 ReadbackRequestCallback& callback, |
| 1248 const SkColorType color_type) { | 1248 const SkColorType preferred_color_type) { |
| 1249 if (delegated_frame_host_) { | 1249 if (delegated_frame_host_) { |
| 1250 delegated_frame_host_->CopyFromCompositingSurface( | 1250 delegated_frame_host_->CopyFromCompositingSurface( |
| 1251 src_subrect, dst_size, callback, color_type); | 1251 src_subrect, dst_size, callback, preferred_color_type); |
| 1252 } | 1252 } |
| 1253 } | 1253 } |
| 1254 | 1254 |
| 1255 void RenderWidgetHostViewMac::CopyFromCompositingSurfaceToVideoFrame( | 1255 void RenderWidgetHostViewMac::CopyFromCompositingSurfaceToVideoFrame( |
| 1256 const gfx::Rect& src_subrect, | 1256 const gfx::Rect& src_subrect, |
| 1257 const scoped_refptr<media::VideoFrame>& target, | 1257 const scoped_refptr<media::VideoFrame>& target, |
| 1258 const base::Callback<void(bool)>& callback) { | 1258 const base::Callback<void(bool)>& callback) { |
| 1259 if (delegated_frame_host_) { | 1259 if (delegated_frame_host_) { |
| 1260 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( | 1260 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( |
| 1261 src_subrect, target, callback); | 1261 src_subrect, target, callback); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 return; | 1707 return; |
| 1708 | 1708 |
| 1709 // Wait for a frame of the right size to come in. | 1709 // Wait for a frame of the right size to come in. |
| 1710 if (browser_compositor_) | 1710 if (browser_compositor_) |
| 1711 browser_compositor_->accelerated_widget_mac()->BeginPumpingFrames(); | 1711 browser_compositor_->accelerated_widget_mac()->BeginPumpingFrames(); |
| 1712 render_widget_host_->PauseForPendingResizeOrRepaints(); | 1712 render_widget_host_->PauseForPendingResizeOrRepaints(); |
| 1713 if (browser_compositor_) | 1713 if (browser_compositor_) |
| 1714 browser_compositor_->accelerated_widget_mac()->EndPumpingFrames(); | 1714 browser_compositor_->accelerated_widget_mac()->EndPumpingFrames(); |
| 1715 } | 1715 } |
| 1716 | 1716 |
| 1717 SkColorType RenderWidgetHostViewMac::PreferredReadbackFormat() { | |
| 1718 return kN32_SkColorType; | |
| 1719 } | |
| 1720 | |
| 1721 //////////////////////////////////////////////////////////////////////////////// | 1717 //////////////////////////////////////////////////////////////////////////////// |
| 1722 // gfx::DisplayObserver, public: | 1718 // gfx::DisplayObserver, public: |
| 1723 | 1719 |
| 1724 void RenderWidgetHostViewMac::OnDisplayAdded(const gfx::Display& display) { | 1720 void RenderWidgetHostViewMac::OnDisplayAdded(const gfx::Display& display) { |
| 1725 } | 1721 } |
| 1726 | 1722 |
| 1727 void RenderWidgetHostViewMac::OnDisplayRemoved(const gfx::Display& display) { | 1723 void RenderWidgetHostViewMac::OnDisplayRemoved(const gfx::Display& display) { |
| 1728 } | 1724 } |
| 1729 | 1725 |
| 1730 void RenderWidgetHostViewMac::OnDisplayMetricsChanged( | 1726 void RenderWidgetHostViewMac::OnDisplayMetricsChanged( |
| (...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3490 | 3486 |
| 3491 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3487 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3492 // regions that are not draggable. (See ControlRegionView in | 3488 // regions that are not draggable. (See ControlRegionView in |
| 3493 // native_app_window_cocoa.mm). This requires the render host view to be | 3489 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3494 // draggable by default. | 3490 // draggable by default. |
| 3495 - (BOOL)mouseDownCanMoveWindow { | 3491 - (BOOL)mouseDownCanMoveWindow { |
| 3496 return YES; | 3492 return YES; |
| 3497 } | 3493 } |
| 3498 | 3494 |
| 3499 @end | 3495 @end |
| OLD | NEW |