| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/compositor/offscreen_browser_compositor_output_surface
.h" | 5 #include "content/browser/compositor/offscreen_browser_compositor_output_surface
.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "cc/output/output_surface_client.h" | 11 #include "cc/output/output_surface_client.h" |
| 12 #include "cc/output/output_surface_frame.h" | 12 #include "cc/output/output_surface_frame.h" |
| 13 #include "cc/resources/resource_provider.h" | 13 #include "cc/resources/resource_provider.h" |
| 14 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" | 14 #include "components/viz/display_compositor/compositor_overlay_candidate_validat
or.h" |
| 15 #include "content/browser/compositor/reflector_impl.h" | 15 #include "content/browser/compositor/reflector_impl.h" |
| 16 #include "content/browser/compositor/reflector_texture.h" | 16 #include "content/browser/compositor/reflector_texture.h" |
| 17 #include "content/browser/renderer_host/render_widget_host_impl.h" | 17 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 #include "gpu/command_buffer/client/context_support.h" | 19 #include "gpu/command_buffer/client/context_support.h" |
| 20 #include "gpu/command_buffer/client/gles2_interface.h" | 20 #include "gpu/command_buffer/client/gles2_interface.h" |
| 21 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 21 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
| 22 #include "third_party/khronos/GLES2/gl2.h" | 22 #include "third_party/khronos/GLES2/gl2.h" |
| 23 #include "third_party/khronos/GLES2/gl2ext.h" | 23 #include "third_party/khronos/GLES2/gl2ext.h" |
| 24 | 24 |
| 25 using gpu::gles2::GLES2Interface; | 25 using gpu::gles2::GLES2Interface; |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 static cc::ResourceFormat kFboTextureFormat = cc::RGBA_8888; | 29 static cc::ResourceFormat kFboTextureFormat = cc::RGBA_8888; |
| 30 | 30 |
| 31 OffscreenBrowserCompositorOutputSurface:: | 31 OffscreenBrowserCompositorOutputSurface:: |
| 32 OffscreenBrowserCompositorOutputSurface( | 32 OffscreenBrowserCompositorOutputSurface( |
| 33 scoped_refptr<ui::ContextProviderCommandBuffer> context, | 33 scoped_refptr<ui::ContextProviderCommandBuffer> context, |
| 34 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, | 34 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, |
| 35 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 35 std::unique_ptr<viz::CompositorOverlayCandidateValidator> |
| 36 overlay_candidate_validator) | 36 overlay_candidate_validator) |
| 37 : BrowserCompositorOutputSurface(std::move(context), | 37 : BrowserCompositorOutputSurface(std::move(context), |
| 38 update_vsync_parameters_callback, | 38 update_vsync_parameters_callback, |
| 39 std::move(overlay_candidate_validator)), | 39 std::move(overlay_candidate_validator)), |
| 40 weak_ptr_factory_(this) { | 40 weak_ptr_factory_(this) { |
| 41 capabilities_.uses_default_gl_framebuffer = false; | 41 capabilities_.uses_default_gl_framebuffer = false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 OffscreenBrowserCompositorOutputSurface:: | 44 OffscreenBrowserCompositorOutputSurface:: |
| 45 ~OffscreenBrowserCompositorOutputSurface() { | 45 ~OffscreenBrowserCompositorOutputSurface() { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 void OffscreenBrowserCompositorOutputSurface::OnSwapBuffersComplete( | 194 void OffscreenBrowserCompositorOutputSurface::OnSwapBuffersComplete( |
| 195 const std::vector<ui::LatencyInfo>& latency_info) { | 195 const std::vector<ui::LatencyInfo>& latency_info) { |
| 196 RenderWidgetHostImpl::OnGpuSwapBuffersCompleted(latency_info); | 196 RenderWidgetHostImpl::OnGpuSwapBuffersCompleted(latency_info); |
| 197 client_->DidReceiveSwapBuffersAck(); | 197 client_->DidReceiveSwapBuffersAck(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace content | 200 } // namespace content |
| OLD | NEW |