Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / content / browser / compositor / gpu_surfaceless_browser_compositor_output_surface.h
blobe114ba96acdc43dd8779aac6459efb0ccca5f997
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
8 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
10 namespace content {
12 class BrowserGpuMemoryBufferManager;
13 class BufferQueue;
14 class GLHelper;
16 class GpuSurfacelessBrowserCompositorOutputSurface
17 : public GpuBrowserCompositorOutputSurface {
18 public:
19 GpuSurfacelessBrowserCompositorOutputSurface(
20 const scoped_refptr<ContextProviderCommandBuffer>& context,
21 const scoped_refptr<ContextProviderCommandBuffer>& worker_context,
22 int surface_id,
23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
24 scoped_ptr<BrowserCompositorOverlayCandidateValidator>
25 overlay_candidate_validator,
26 unsigned int target,
27 unsigned int internalformat,
28 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager);
29 ~GpuSurfacelessBrowserCompositorOutputSurface() override;
31 private:
32 // cc::OutputSurface implementation.
33 void SwapBuffers(cc::CompositorFrame* frame) override;
34 void OnSwapBuffersComplete() override;
35 void BindFramebuffer() override;
36 void Reshape(const gfx::Size& size, float scale_factor) override;
37 unsigned GetOverlayTextureId() const override;
39 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info,
40 gfx::SwapResult result) override;
41 #if defined(OS_MACOSX)
42 void OnSurfaceDisplayed() override;
43 #endif
45 unsigned int internalformat_;
46 scoped_ptr<GLHelper> gl_helper_;
47 scoped_ptr<BufferQueue> output_surface_;
48 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager_;
51 } // namespace content
53 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_