Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / content / browser / compositor / offscreen_browser_compositor_output_surface.h
blobe9fbe6d7c5fde873855bfa5a77a9e702b9fb99cf
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
8 #include "base/cancelable_callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/browser/compositor/browser_compositor_output_surface.h"
12 namespace ui {
13 class CompositorVSyncManager;
16 namespace content {
17 class CommandBufferProxyImpl;
19 class OffscreenBrowserCompositorOutputSurface
20 : public BrowserCompositorOutputSurface {
21 public:
22 OffscreenBrowserCompositorOutputSurface(
23 const scoped_refptr<ContextProviderCommandBuffer>& context,
24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
25 scoped_ptr<BrowserCompositorOverlayCandidateValidator>
26 overlay_candidate_validator);
28 ~OffscreenBrowserCompositorOutputSurface() override;
30 protected:
31 // cc::OutputSurface:
32 void EnsureBackbuffer() override;
33 void DiscardBackbuffer() override;
34 void Reshape(const gfx::Size& size, float scale_factor) override;
35 void BindFramebuffer() override;
36 void SwapBuffers(cc::CompositorFrame* frame) override;
38 #if defined(OS_MACOSX)
39 void OnSurfaceDisplayed() override {};
40 void SetSurfaceSuspendedForRecycle(bool suspended) override {};
41 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override;
42 #endif
44 uint32 fbo_;
45 bool is_backbuffer_discarded_;
46 uint32 backing_texture_id_;
48 base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface>
49 weak_ptr_factory_;
51 private:
52 DISALLOW_COPY_AND_ASSIGN(OffscreenBrowserCompositorOutputSurface);
55 } // namespace content
57 #endif // CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_