| 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/compositor_frame.h" | 11 #include "cc/output/compositor_frame.h" |
| 12 #include "cc/output/context_provider.h" | 12 #include "cc/output/context_provider.h" |
| 13 #include "cc/output/output_surface_client.h" | 13 #include "cc/output/output_surface_client.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<SurfacesContextProvider> context_provider, |
| 22 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source) | 22 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source) |
| 23 : cc::OutputSurface(context_provider, nullptr, nullptr), | 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 context_provider->SetDelegate(this); | 26 context_provider->SetDelegate(this); |
| 27 } | 27 } |
| 28 | 28 |
| 29 DirectOutputSurface::~DirectOutputSurface() = default; | 29 DirectOutputSurface::~DirectOutputSurface() = default; |
| 30 | 30 |
| 31 bool DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { | 31 bool DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { |
| 32 if (!cc::OutputSurface::BindToClient(client)) | 32 if (!cc::OutputSurface::BindToClient(client)) |
| 33 return false; | 33 return false; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 weak_ptr_factory_.GetWeakPtr())); | 71 weak_ptr_factory_.GetWeakPtr())); |
| 72 } | 72 } |
| 73 | 73 |
| 74 uint32_t DirectOutputSurface::GetFramebufferCopyTextureFormat() { | 74 uint32_t DirectOutputSurface::GetFramebufferCopyTextureFormat() { |
| 75 // TODO(danakj): What attributes are used for the default framebuffer here? | 75 // TODO(danakj): What attributes are used for the default framebuffer here? |
| 76 // Can it have alpha? SurfacesContextProvider doesn't take any attributes. | 76 // Can it have alpha? SurfacesContextProvider doesn't take any attributes. |
| 77 return GL_RGB; | 77 return GL_RGB; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace ui | 80 } // namespace ui |
| OLD | NEW |