Chromium Code Reviews| 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 "services/ui/surfaces/direct_output_surface.h" | 5 #include "services/ui/surfaces/direct_output_surface.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 12 #include "cc/output/output_surface_client.h" | 12 #include "cc/output/output_surface_client.h" |
| 13 #include "cc/output/output_surface_frame.h" | 13 #include "cc/output/output_surface_frame.h" |
| 14 #include "cc/scheduler/begin_frame_source.h" | 14 #include "cc/scheduler/begin_frame_source.h" |
| 15 #include "gpu/command_buffer/client/context_support.h" | 15 #include "gpu/command_buffer/client/context_support.h" |
| 16 #include "gpu/command_buffer/client/gles2_interface.h" | 16 #include "gpu/command_buffer/client/gles2_interface.h" |
| 17 | 17 |
| 18 namespace ui { | 18 namespace ui { |
| 19 | 19 |
| 20 DirectOutputSurface::DirectOutputSurface( | 20 DirectOutputSurface::DirectOutputSurface( |
| 21 scoped_refptr<SurfacesContextProvider> context_provider, | 21 scoped_refptr<cc::ContextProvider> context_provider, |
| 22 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source) | 22 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source) |
| 23 : cc::OutputSurface(context_provider), | 23 : cc::OutputSurface(context_provider), |
| 24 synthetic_begin_frame_source_(synthetic_begin_frame_source), | 24 synthetic_begin_frame_source_(synthetic_begin_frame_source), |
| 25 weak_ptr_factory_(this) { | 25 weak_ptr_factory_(this) { |
| 26 capabilities_.flipped_output_surface = | 26 capabilities_.flipped_output_surface = |
| 27 context_provider->ContextCapabilities().flips_vertically; | 27 context_provider->ContextCapabilities().flips_vertically; |
| 28 context_provider->SetDelegate(this); | 28 static_cast<SurfacesContextProvider*>(context_provider.get()) |
|
kylechar
2016/11/02 03:37:23
Is this cast back to the actual type a temporary t
Fady Samuel
2016/11/02 04:31:22
I'm passing around a SurfacesContextProvider direc
| |
| 29 ->SetDelegate(this); | |
| 29 } | 30 } |
| 30 | 31 |
| 31 DirectOutputSurface::~DirectOutputSurface() {} | 32 DirectOutputSurface::~DirectOutputSurface() {} |
| 32 | 33 |
| 33 void DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { | 34 void DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { |
| 34 DCHECK(client); | 35 DCHECK(client); |
| 35 DCHECK(!client_); | 36 DCHECK(!client_); |
| 36 client_ = client; | 37 client_ = client; |
| 37 } | 38 } |
| 38 | 39 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 synthetic_begin_frame_source_->OnUpdateVSyncParameters( | 112 synthetic_begin_frame_source_->OnUpdateVSyncParameters( |
| 112 timebase, | 113 timebase, |
| 113 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); | 114 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); |
| 114 } | 115 } |
| 115 | 116 |
| 116 void DirectOutputSurface::OnSwapBuffersComplete() { | 117 void DirectOutputSurface::OnSwapBuffersComplete() { |
| 117 client_->DidReceiveSwapBuffersAck(); | 118 client_->DidReceiveSwapBuffersAck(); |
| 118 } | 119 } |
| 119 | 120 |
| 120 } // namespace ui | 121 } // namespace ui |
| OLD | NEW |