| 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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 float surface_scale_factor, | 1287 float surface_scale_factor, |
| 1288 const ui::LatencyInfo& latency_info) { | 1288 const ui::LatencyInfo& latency_info) { |
| 1289 if (render_widget_host_->is_hidden()) | 1289 if (render_widget_host_->is_hidden()) |
| 1290 return; | 1290 return; |
| 1291 | 1291 |
| 1292 NSWindow* window = [cocoa_view_ window]; | 1292 NSWindow* window = [cocoa_view_ window]; |
| 1293 if (window_number() <= 0) { | 1293 if (window_number() <= 0) { |
| 1294 // There is no window to present so capturing during present won't work. | 1294 // There is no window to present so capturing during present won't work. |
| 1295 // We check if frame subscriber wants this frame and capture manually. | 1295 // We check if frame subscriber wants this frame and capture manually. |
| 1296 if (compositing_iosurface_ && frame_subscriber_) { | 1296 if (compositing_iosurface_ && frame_subscriber_) { |
| 1297 const base::Time present_time = base::Time::Now(); | 1297 const base::TimeTicks present_time = base::TimeTicks::Now(); |
| 1298 scoped_refptr<media::VideoFrame> frame; | 1298 scoped_refptr<media::VideoFrame> frame; |
| 1299 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback; | 1299 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback; |
| 1300 if (frame_subscriber_->ShouldCaptureFrame(present_time, | 1300 if (frame_subscriber_->ShouldCaptureFrame(present_time, |
| 1301 &frame, &callback)) { | 1301 &frame, &callback)) { |
| 1302 compositing_iosurface_->SetIOSurface( | 1302 compositing_iosurface_->SetIOSurface( |
| 1303 surface_handle, size, surface_scale_factor, latency_info); | 1303 surface_handle, size, surface_scale_factor, latency_info); |
| 1304 compositing_iosurface_->CopyToVideoFrame( | 1304 compositing_iosurface_->CopyToVideoFrame( |
| 1305 gfx::Rect(size), frame, | 1305 gfx::Rect(size), frame, |
| 1306 base::Bind(callback, present_time)); | 1306 base::Bind(callback, present_time)); |
| 1307 return; | 1307 return; |
| (...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3983 return YES; | 3983 return YES; |
| 3984 } | 3984 } |
| 3985 | 3985 |
| 3986 - (BOOL)isOpaque { | 3986 - (BOOL)isOpaque { |
| 3987 if (renderWidgetHostView_->use_core_animation_) | 3987 if (renderWidgetHostView_->use_core_animation_) |
| 3988 return YES; | 3988 return YES; |
| 3989 return [super isOpaque]; | 3989 return [super isOpaque]; |
| 3990 } | 3990 } |
| 3991 | 3991 |
| 3992 @end | 3992 @end |
| OLD | NEW |