OLD | NEW |
---|---|
(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; | |
18 class OutputSurface; | |
19 } | |
20 | |
21 namespace content { | |
22 | |
23 // TODO(mkosiba): Add a comment! | |
24 class SynchronousCompositorImpl | |
25 : public SynchronousCompositor, | |
26 public SynchronousCompositorOutputSurface::Delegate, | |
27 public cc::LayerScrollOffsetDelegate { | |
28 public: | |
29 explicit SynchronousCompositorImpl(int32 routing_id); | |
30 virtual ~SynchronousCompositorImpl(); | |
31 | |
32 scoped_ptr<cc::OutputSurface> CreateOutputSurface(); | |
33 void didCreateInputHandler(base::WeakPtr<cc::InputHandler> input_handler); | |
jamesr
2013/05/22 01:28:13
why is this function named in WebKit style?
mkosiba (inactive)
2013/05/22 17:26:17
no idea. probably because most of the didDoSomethi
| |
34 | |
35 // SynchronousCompositor | |
36 virtual bool IsHwReady() OVERRIDE; | |
37 virtual void SetClient(SynchronousCompositorClient* compositor_client) | |
38 OVERRIDE; | |
39 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; | |
40 virtual bool DemandDrawHw( | |
41 gfx::Size view_size, | |
42 const gfx::Transform& transform, | |
43 gfx::Rect clip) OVERRIDE; | |
44 | |
45 // SynchronousCompositorOutputSurface::Delegate | |
46 virtual void SetContinuousInvalidate(bool enable) OVERRIDE; | |
47 virtual void DidCreateSynchronousCompositor() OVERRIDE; | |
48 virtual void DidDestroyCompositor() OVERRIDE; | |
49 | |
50 // LayerScrollOffsetDelegate | |
51 virtual void SetTotalScrollOffset(gfx::Vector2dF new_value) OVERRIDE; | |
52 virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE; | |
53 | |
54 private: | |
55 bool CalledOnValidThread() const; | |
56 void didCreateInputHandlerOnImplThread( | |
57 base::WeakPtr<cc::InputHandler> input_handler); | |
58 | |
59 int routing_id_; | |
60 SynchronousCompositorClient* compositor_client_; | |
61 SynchronousCompositorOutputSurface* output_surface_; | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | |
64 }; | |
65 | |
66 } // namespace content | |
67 | |
68 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | |
OLD | NEW |