OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser_compositor_view_mac.h" | 5 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 void BrowserCompositorMac::SetDisplayColorSpace( | 293 void BrowserCompositorMac::SetDisplayColorSpace( |
294 const gfx::ColorSpace& color_space) { | 294 const gfx::ColorSpace& color_space) { |
295 if (recyclable_compositor_) | 295 if (recyclable_compositor_) |
296 recyclable_compositor_->compositor()->SetDisplayColorSpace(color_space); | 296 recyclable_compositor_->compositor()->SetDisplayColorSpace(color_space); |
297 } | 297 } |
298 | 298 |
299 void BrowserCompositorMac::UpdateVSyncParameters( | 299 void BrowserCompositorMac::UpdateVSyncParameters( |
300 const base::TimeTicks& timebase, | 300 const base::TimeTicks& timebase, |
301 const base::TimeDelta& interval) { | 301 const base::TimeDelta& interval) { |
302 if (recyclable_compositor_) { | 302 if (recyclable_compositor_) { |
303 recyclable_compositor_->compositor() | 303 recyclable_compositor_->compositor()->SetDisplayVSyncParameters( |
304 ->vsync_manager() | 304 timebase, interval); |
305 ->UpdateVSyncParameters(timebase, interval); | |
306 recyclable_compositor_->compositor() | |
307 ->context_factory() | |
308 ->SetDisplayVSyncParameters(recyclable_compositor_->compositor(), | |
309 timebase, interval); | |
310 } | 305 } |
311 } | 306 } |
312 | 307 |
313 void BrowserCompositorMac::SetRenderWidgetHostIsHidden(bool hidden) { | 308 void BrowserCompositorMac::SetRenderWidgetHostIsHidden(bool hidden) { |
314 render_widget_host_is_hidden_ = hidden; | 309 render_widget_host_is_hidden_ = hidden; |
315 UpdateState(); | 310 UpdateState(); |
316 } | 311 } |
317 | 312 |
318 void BrowserCompositorMac::SetNSViewAttachedToWindow(bool attached) { | 313 void BrowserCompositorMac::SetNSViewAttachedToWindow(bool attached) { |
319 ns_view_attached_to_window_ = attached; | 314 ns_view_attached_to_window_ = attached; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 462 |
468 bool BrowserCompositorMac::IsAutoResizeEnabled() const { | 463 bool BrowserCompositorMac::IsAutoResizeEnabled() const { |
469 NOTREACHED(); | 464 NOTREACHED(); |
470 return false; | 465 return false; |
471 } | 466 } |
472 | 467 |
473 //////////////////////////////////////////////////////////////////////////////// | 468 //////////////////////////////////////////////////////////////////////////////// |
474 // cc::BeginFrameSourceBase, public: | 469 // cc::BeginFrameSourceBase, public: |
475 | 470 |
476 void BrowserCompositorMac::OnBeginFrame(const cc::BeginFrameArgs& args) { | 471 void BrowserCompositorMac::OnBeginFrame(const cc::BeginFrameArgs& args) { |
477 delegated_frame_host_->SetVSyncParameters(args.frame_time, args.interval); | |
478 client_->BrowserCompositorMacSendBeginFrame(args); | 472 client_->BrowserCompositorMacSendBeginFrame(args); |
479 last_begin_frame_args_ = args; | 473 last_begin_frame_args_ = args; |
480 } | 474 } |
481 | 475 |
482 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { | 476 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { |
483 return last_begin_frame_args_; | 477 return last_begin_frame_args_; |
484 } | 478 } |
485 | 479 |
486 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { | 480 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { |
487 // Only used on Android WebView. | 481 // Only used on Android WebView. |
488 } | 482 } |
489 | 483 |
490 } // namespace content | 484 } // namespace content |
OLD | NEW |