OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 static void Initialize(); | 35 static void Initialize(); |
36 | 36 |
37 // Creates and returns a compositor instance. |root_window| needs to outlive | 37 // Creates and returns a compositor instance. |root_window| needs to outlive |
38 // the compositor as it manages callbacks on the compositor. | 38 // the compositor as it manages callbacks on the compositor. |
39 static Compositor* Create(CompositorClient* client, | 39 static Compositor* Create(CompositorClient* client, |
40 gfx::NativeWindow root_window); | 40 gfx::NativeWindow root_window); |
41 | 41 |
42 // Attaches the layer tree. | 42 // Attaches the layer tree. |
43 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; | 43 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; |
44 | 44 |
45 // Set the scale factor from DIP to pixel. | |
46 virtual void setDeviceScaleFactor(float factor) = 0; | |
47 | |
48 // Set the output surface bounds. | 45 // Set the output surface bounds. |
49 virtual void SetWindowBounds(const gfx::Size& size) = 0; | 46 virtual void SetWindowBounds(const gfx::Size& size) = 0; |
50 | 47 |
51 // Set the output surface which the compositor renders into. | 48 // Set the output surface which the compositor renders into. |
52 virtual void SetSurface(jobject surface) = 0; | 49 virtual void SetSurface(jobject surface) = 0; |
53 | 50 |
54 // Tells the view tree to assume a transparent background when rendering. | 51 // Tells the view tree to assume a transparent background when rendering. |
55 virtual void SetHasTransparentBackground(bool flag) = 0; | 52 virtual void SetHasTransparentBackground(bool flag) = 0; |
56 | 53 |
57 // Request layout and draw. You only need to call this if you need to trigger | 54 // Request layout and draw. You only need to call this if you need to trigger |
58 // Composite *without* having modified the layer tree. | 55 // Composite *without* having modified the layer tree. |
59 virtual void SetNeedsComposite() = 0; | 56 virtual void SetNeedsComposite() = 0; |
60 | 57 |
61 // Returns the UI resource provider associated with the compositor. | 58 // Returns the UI resource provider associated with the compositor. |
62 virtual ui::UIResourceProvider& GetUIResourceProvider() = 0; | 59 virtual ui::UIResourceProvider& GetUIResourceProvider() = 0; |
63 | 60 |
64 // Returns the resource manager associated with the compositor. | 61 // Returns the resource manager associated with the compositor. |
65 virtual ui::ResourceManager& GetResourceManager() = 0; | 62 virtual ui::ResourceManager& GetResourceManager() = 0; |
66 | 63 |
67 protected: | 64 protected: |
68 Compositor() {} | 65 Compositor() {} |
69 }; | 66 }; |
70 | 67 |
71 } // namespace content | 68 } // namespace content |
72 | 69 |
73 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 70 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
OLD | NEW |