IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / aura / browser_compositor_output_surface.h
blob79f757a56a27204e6bcdbeea8c959d95bd867533
1 // Copyright (c) 2013 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_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
8 #include "base/id_map.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/non_thread_safe.h"
11 #include "cc/output/output_surface.h"
12 #include "content/common/content_export.h"
14 namespace base { class MessageLoopProxy; }
16 namespace cc {
17 class SoftwareOutputDevice;
20 namespace ui { class Compositor; }
22 namespace content {
23 class ContextProviderCommandBuffer;
24 class ReflectorImpl;
25 class WebGraphicsContext3DCommandBufferImpl;
27 class CONTENT_EXPORT BrowserCompositorOutputSurface
28 : public cc::OutputSurface,
29 public base::NonThreadSafe {
30 public:
31 virtual ~BrowserCompositorOutputSurface();
33 // cc::OutputSurface implementation.
34 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE;
35 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE;
37 void OnUpdateVSyncParameters(base::TimeTicks timebase,
38 base::TimeDelta interval);
40 void SetReflector(ReflectorImpl* reflector);
42 protected:
43 // Constructor used by the accelerated implementation.
44 BrowserCompositorOutputSurface(
45 const scoped_refptr<ContextProviderCommandBuffer>& context,
46 int surface_id,
47 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
48 base::MessageLoopProxy* compositor_message_loop,
49 base::WeakPtr<ui::Compositor> compositor);
51 // Constructor used by the software implementation.
52 BrowserCompositorOutputSurface(
53 scoped_ptr<cc::SoftwareOutputDevice> software_device,
54 int surface_id,
55 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
56 base::MessageLoopProxy* compositor_message_loop,
57 base::WeakPtr<ui::Compositor> compositor);
59 int surface_id_;
60 IDMap<BrowserCompositorOutputSurface>* output_surface_map_;
62 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_;
63 base::WeakPtr<ui::Compositor> compositor_;
64 scoped_refptr<ReflectorImpl> reflector_;
66 private:
67 void Initialize();
69 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface);
72 } // namespace content
74 #endif // CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_