Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / compositor / software_browser_compositor_output_surface.h
blob1df9b366eddab1e068f3b9a50970863541456739
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_SOFTWARE_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_SOFTWARE_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
8 #include "base/memory/weak_ptr.h"
9 #include "content/browser/compositor/browser_compositor_output_surface.h"
10 #include "content/common/content_export.h"
12 namespace cc {
13 class SoftwareOutputDevice;
16 namespace ui {
17 class CompositorVSyncManager;
20 namespace content {
22 class BrowserCompositorOutputSurfaceProxy;
24 class CONTENT_EXPORT SoftwareBrowserCompositorOutputSurface
25 : public BrowserCompositorOutputSurface {
26 public:
27 SoftwareBrowserCompositorOutputSurface(
28 scoped_refptr<BrowserCompositorOutputSurfaceProxy> surface_proxy,
29 scoped_ptr<cc::SoftwareOutputDevice> software_device,
30 int surface_id,
31 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
32 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager);
34 ~SoftwareBrowserCompositorOutputSurface() override;
36 private:
37 void SwapBuffers(cc::CompositorFrame* frame) override;
39 #if defined(OS_MACOSX)
40 void OnSurfaceDisplayed() override;
41 #endif
43 // On the software path we need to explicitly call the proxy to update the
44 // VSync parameters.
45 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_;
47 DISALLOW_COPY_AND_ASSIGN(SoftwareBrowserCompositorOutputSurface);
50 } // namespace content
52 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_