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

Unified Diff: cc/output/in_process_context_provider.h

Issue 2498053004: Add InProcessContextProvider and update InProcessCommandBuffer (Closed)
Patch Set: Revert experiments and fix android_webview Created 4 years, 1 month 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 | « cc/DEPS ('k') | cc/output/in_process_context_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/in_process_context_provider.h
diff --git a/cc/output/in_process_context_provider.h b/cc/output/in_process_context_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..e42c094797d08b349a0cf41a4cac214116b4d909
--- /dev/null
+++ b/cc/output/in_process_context_provider.h
@@ -0,0 +1,84 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_
+#define CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "base/synchronization/lock.h"
+#include "cc/output/context_cache_controller.h"
+#include "cc/output/context_provider.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "gpu/ipc/in_process_command_buffer.h"
+#include "ui/gfx/native_widget_types.h"
+
+class GrContext;
+
+namespace gpu {
+class GLInProcessContext;
+class GpuMemoryBufferManager;
+class ImageFactory;
+struct SharedMemoryLimits;
+class SyncPointManager;
+namespace gles2 {
+class MailboxManager;
+}
+}
+
+namespace skia_bindings {
+class GrContextForGLES2Interface;
+}
+
+namespace cc {
+
+class InProcessContextProvider : public ContextProvider {
+ public:
+ InProcessContextProvider(
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
+ gpu::SurfaceHandle widget,
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ gpu::ImageFactory* image_factory,
+ const gpu::SharedMemoryLimits& limits,
+ InProcessContextProvider* shared_context);
+
+ bool BindToCurrentThread() override;
+ gpu::gles2::GLES2Interface* ContextGL() override;
+ gpu::ContextSupport* ContextSupport() override;
+ class GrContext* GrContext() override;
+ ContextCacheController* CacheController() override;
+ void InvalidateGrContext(uint32_t state) override;
+ base::Lock* GetLock() override;
+ gpu::Capabilities ContextCapabilities() override;
+ void SetLostContextCallback(
+ const LostContextCallback& lost_context_callback) override;
+
+ uint32_t GetCopyTextureInternalFormat();
+
+ void SetSwapBuffersCompletionCallback(
+ const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback&
+ callback);
+
+ void SetUpdateVSyncParametersCallback(
+ const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback&
+ callback);
+
+ protected:
+ friend class base::RefCountedThreadSafe<InProcessContextProvider>;
+ ~InProcessContextProvider() override;
+
+ private:
+ const gpu::gles2::ContextCreationAttribHelper attributes_;
+
+ base::Lock context_lock_;
+ std::unique_ptr<gpu::GLInProcessContext> context_;
+ std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_;
+ std::unique_ptr<ContextCacheController> cache_controller_;
+};
+
+} // namespace cc
+
+#endif // CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_
« no previous file with comments | « cc/DEPS ('k') | cc/output/in_process_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698