Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: content/renderer/android/synchronous_compositor_impl.h

Issue 15875009: Refactor SynchronousCompositor out of SynchronousCompositorOutputSurface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Joth's feedback Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 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.
4
5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_IMPL_H_
6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_IMPL_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "cc/input/layer_scroll_offset_delegate.h"
13 #include "content/public/renderer/android/synchronous_compositor.h"
14 #include "content/renderer/android/synchronous_compositor_output_surface.h"
15
16 namespace cc {
17 class InputHandler;
jdduke (slow) 2013/05/24 15:16:41 Nit: I think you can remove this forward decl now?
mkosiba (inactive) 2013/05/24 16:22:34 Done.
18 class OutputSurface;
19 }
20
21 namespace content {
22
23 // The purpose of this class is to act as the intermediary between the various
24 // components that make up the 'synchronous compositor mode' implementation and
25 // expose their functionality via the SynchronousCompositor interface.
26 // This class is created on the main thread but most of the APIs are called
27 // from the Compositor thread.
28 class SynchronousCompositorImpl
29 : public SynchronousCompositor,
30 public SynchronousCompositorOutputSurfaceDelegate {
31 public:
32 explicit SynchronousCompositorImpl(int32 routing_id);
33 virtual ~SynchronousCompositorImpl();
34
35 scoped_ptr<cc::OutputSurface> CreateOutputSurface();
36
37 // SynchronousCompositor
38 virtual bool IsHwReady() OVERRIDE;
39 virtual void SetClient(SynchronousCompositorClient* compositor_client)
40 OVERRIDE;
41 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE;
42 virtual bool DemandDrawHw(
43 gfx::Size view_size,
44 const gfx::Transform& transform,
45 gfx::Rect clip) OVERRIDE;
46
47 // SynchronousCompositorOutputSurfaceDelegate
48 virtual void SetContinuousInvalidate(bool enable) OVERRIDE;
49 virtual void DidCreateSynchronousOutputSurface() OVERRIDE;
50 virtual void DidDestroySynchronousOutputSurface() OVERRIDE;
51
52 private:
53 bool CalledOnValidThread() const;
54
55 int routing_id_;
56 SynchronousCompositorClient* compositor_client_;
57 SynchronousCompositorOutputSurface* output_surface_;
58
59 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698