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

Unified Diff: content/public/browser/android/compositor.h

Issue 2731833002: content: Add public context creation API. (Closed)
Patch Set: piman's comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/android/compositor.h
diff --git a/content/public/browser/android/compositor.h b/content/public/browser/android/compositor.h
index be022bc50498cf7faed970b281280fb86e3ddf1a..02f188645bed7a4a1c6cf18a6628d34795bebc07 100644
--- a/content/public/browser/android/compositor.h
+++ b/content/public/browser/android/compositor.h
@@ -8,15 +8,25 @@
#include "base/callback.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "content/common/content_export.h"
+#include "gpu/ipc/common/surface_handle.h"
#include "ui/android/resources/ui_resource_provider.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
namespace cc {
+class ContextProvider;
class Layer;
}
+namespace gpu {
+namespace gles2 {
+struct ContextCreationAttribHelper;
+} // namespace gles2
+
+struct SharedMemoryLimits;
+}
+
namespace ui {
class ResourceManager;
class UIResourceProvider;
@@ -34,6 +44,16 @@ class CONTENT_EXPORT Compositor {
// instance can be used. This should be called only once.
static void Initialize();
+ // Creates a GL context for the provided |handle|. If a null handle is passed,
+ // an offscreen context is created.
+ using ContextProviderCallback =
+ base::Callback<void(scoped_refptr<cc::ContextProvider>)>;
+ static void CreateContextProvider(
+ gpu::SurfaceHandle handle,
+ gpu::gles2::ContextCreationAttribHelper attributes,
+ gpu::SharedMemoryLimits shared_memory_limits,
+ ContextProviderCallback callback);
+
// Creates and returns a compositor instance. |root_window| needs to outlive
// the compositor as it manages callbacks on the compositor.
static Compositor* Create(CompositorClient* client,
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698