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 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SUR FACE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SUR FACE_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SUR FACE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SUR FACE_H_ |
| 7 | 7 |
| 8 #include "base/cancelable_callback.h" | |
| 8 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" | 9 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
| 9 | 10 |
| 10 namespace content { | 11 namespace content { |
| 11 | 12 |
| 12 class BufferQueue; | 13 class BufferQueue; |
| 13 class GLHelper; | 14 class GLHelper; |
| 14 | 15 |
| 15 class GpuSurfacelessBrowserCompositorOutputSurface | 16 class GpuSurfacelessBrowserCompositorOutputSurface |
| 16 : public GpuBrowserCompositorOutputSurface { | 17 : public GpuBrowserCompositorOutputSurface { |
| 17 public: | 18 public: |
| 18 GpuSurfacelessBrowserCompositorOutputSurface( | 19 GpuSurfacelessBrowserCompositorOutputSurface( |
| 19 const scoped_refptr<ContextProviderCommandBuffer>& context, | 20 const scoped_refptr<ContextProviderCommandBuffer>& context, |
| 20 int surface_id, | 21 int surface_id, |
| 21 IDMap<BrowserCompositorOutputSurface>* output_surface_map, | 22 IDMap<BrowserCompositorOutputSurface>* output_surface_map, |
| 22 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 23 scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator, | 24 scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator, |
| 24 unsigned internalformat, | 25 unsigned internalformat, |
| 25 bool use_own_gl_helper); | 26 bool use_own_gl_helper); |
| 26 ~GpuSurfacelessBrowserCompositorOutputSurface() override; | 27 ~GpuSurfacelessBrowserCompositorOutputSurface() override; |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 // cc::OutputSurface implementation. | 30 // cc::OutputSurface implementation. |
| 30 void SwapBuffers(cc::CompositorFrame* frame) override; | 31 void SwapBuffers(cc::CompositorFrame* frame) override; |
| 31 void OnSwapBuffersComplete() override; | 32 void OnSwapBuffersComplete() override; |
| 32 void BindFramebuffer() override; | 33 void BindFramebuffer() override; |
| 33 void Reshape(const gfx::Size& size, float scale_factor) override; | 34 void Reshape(const gfx::Size& size, float scale_factor) override; |
| 34 bool BindToClient(cc::OutputSurfaceClient* client) override; | 35 bool BindToClient(cc::OutputSurfaceClient* client) override; |
| 36 void OnPageFlipCompleted(); | |
| 35 | 37 |
| 36 unsigned int internalformat_; | 38 unsigned int internalformat_; |
| 37 bool use_own_gl_helper_; | 39 bool use_own_gl_helper_; |
| 38 scoped_ptr<GLHelper> gl_helper_; | 40 scoped_ptr<GLHelper> gl_helper_; |
| 39 scoped_ptr<BufferQueue> output_surface_; | 41 scoped_ptr<BufferQueue> output_surface_; |
| 42 base::CancelableCallback<void()> page_flip_completion_callback_; | |
|
alexst (slow to review)
2014/12/10 23:19:25
Any specific reason you chose CancelableCallback?
| |
| 40 }; | 43 }; |
| 41 | 44 |
| 42 } // namespace content | 45 } // namespace content |
| 43 | 46 |
| 44 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_ SURFACE_H_ | 47 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_ SURFACE_H_ |
| OLD | NEW |