| 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 27 matching lines...) Expand all Loading... |
| 38 // An interface to the browser-side compositor. | 38 // An interface to the browser-side compositor. |
| 39 class CONTENT_EXPORT Compositor { | 39 class CONTENT_EXPORT Compositor { |
| 40 public: | 40 public: |
| 41 virtual ~Compositor() {} | 41 virtual ~Compositor() {} |
| 42 | 42 |
| 43 // Performs the global initialization needed before any compositor | 43 // Performs the global initialization needed before any compositor |
| 44 // instance can be used. This should be called only once. | 44 // instance can be used. This should be called only once. |
| 45 static void Initialize(); | 45 static void Initialize(); |
| 46 | 46 |
| 47 // Creates a GL context for the provided |handle|. If a null handle is passed, | 47 // Creates a GL context for the provided |handle|. If a null handle is passed, |
| 48 // an offscreen context is created. | 48 // an offscreen context is created. This must be called on the UI thread. |
| 49 using ContextProviderCallback = | 49 using ContextProviderCallback = |
| 50 base::Callback<void(scoped_refptr<cc::ContextProvider>)>; | 50 base::Callback<void(scoped_refptr<cc::ContextProvider>)>; |
| 51 static void CreateContextProvider( | 51 static void CreateContextProvider( |
| 52 gpu::SurfaceHandle handle, | 52 gpu::SurfaceHandle handle, |
| 53 gpu::gles2::ContextCreationAttribHelper attributes, | 53 gpu::gles2::ContextCreationAttribHelper attributes, |
| 54 gpu::SharedMemoryLimits shared_memory_limits, | 54 gpu::SharedMemoryLimits shared_memory_limits, |
| 55 ContextProviderCallback callback); | 55 ContextProviderCallback callback); |
| 56 | 56 |
| 57 // Creates and returns a compositor instance. |root_window| needs to outlive | 57 // Creates and returns a compositor instance. |root_window| needs to outlive |
| 58 // the compositor as it manages callbacks on the compositor. | 58 // the compositor as it manages callbacks on the compositor. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 81 // Returns the resource manager associated with the compositor. | 81 // Returns the resource manager associated with the compositor. |
| 82 virtual ui::ResourceManager& GetResourceManager() = 0; | 82 virtual ui::ResourceManager& GetResourceManager() = 0; |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 Compositor() {} | 85 Compositor() {} |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace content | 88 } // namespace content |
| 89 | 89 |
| 90 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 90 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |