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

Unified Diff: android_webview/browser/context_provider_in_process.h

Issue 1083843002: android_webview: Remove dependency on webkit's ContextProviderInProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GLInProcess Created 5 years, 8 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
Index: android_webview/browser/context_provider_in_process.h
diff --git a/ui/compositor/test/in_process_context_provider.h b/android_webview/browser/context_provider_in_process.h
similarity index 57%
copy from ui/compositor/test/in_process_context_provider.h
copy to android_webview/browser/context_provider_in_process.h
index 4033a7cf31a9a5ade8e0798e85f5ba1c497f0aaa..072638e46b9c1c0476275d3edd093532c68752cd 100644
--- a/ui/compositor/test/in_process_context_provider.h
+++ b/android_webview/browser/context_provider_in_process.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2015 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 WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_
-#define WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_
+#ifndef ANDROID_WEBVIEW_BROWSER_CONTEXT_PROVIDER_IN_PROCESS_H_
+#define ANDROID_WEBVIEW_BROWSER_CONTEXT_PROVIDER_IN_PROCESS_H_
#include <string>
@@ -12,35 +12,32 @@
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "cc/output/context_provider.h"
-#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "gpu/command_buffer/service/in_process_command_buffer.h"
#include "skia/ext/refptr.h"
-#include "ui/gfx/native_widget_types.h"
+
+namespace gfx {
+class GLSurface;
+}
namespace gpu {
class GLInProcessContext;
}
-namespace ui {
+namespace android_webview {
-class InProcessContextProvider : public cc::ContextProvider {
+class ContextProviderInProcess : public cc::ContextProvider {
boliu 2015/04/20 10:06:05 Call this a different name to avoid confusion, may
tfarina 2015/04/22 02:09:04 Done.
public:
- static scoped_refptr<InProcessContextProvider> Create(
- const gpu::gles2::ContextCreationAttribHelper& attribs,
- bool lose_context_when_out_of_memory,
- gfx::AcceleratedWidget window,
+ static scoped_refptr<ContextProviderInProcess> Create(
+ scoped_refptr<gfx::GLSurface> surface,
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
const std::string& debug_name);
- // Uses default attributes for creating an offscreen context.
- static scoped_refptr<InProcessContextProvider> CreateOffscreen(
- bool lose_context_when_out_of_memory);
-
private:
- InProcessContextProvider(
- const gpu::gles2::ContextCreationAttribHelper& attribs,
- bool lose_context_when_out_of_memory,
- gfx::AcceleratedWidget window,
+ ContextProviderInProcess(
+ scoped_refptr<gfx::GLSurface> surface,
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
const std::string& debug_name);
- ~InProcessContextProvider() override;
+ ~ContextProviderInProcess() override;
// cc::ContextProvider:
bool BindToCurrentThread() override;
@@ -65,12 +62,11 @@ class InProcessContextProvider : public cc::ContextProvider {
base::ThreadChecker main_thread_checker_;
base::ThreadChecker context_thread_checker_;
boliu 2015/04/20 10:06:05 We can assume main_thread and context_thread is al
tfarina 2015/04/22 02:09:04 Done.
+ scoped_refptr<gfx::GLSurface> surface_;
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service_;
boliu 2015/04/20 10:06:05 You can create GLInProcessContext in the construct
tfarina 2015/04/22 02:09:04 Done.
scoped_ptr<gpu::GLInProcessContext> context_;
skia::RefPtr<class GrContext> gr_context_;
- gpu::gles2::ContextCreationAttribHelper attribs_;
- bool lose_context_when_out_of_memory_;
- gfx::AcceleratedWidget window_;
std::string debug_name_;
cc::ContextProvider::Capabilities capabilities_;
@@ -81,9 +77,9 @@ class InProcessContextProvider : public cc::ContextProvider {
base::Lock context_lock_;
- DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider);
+ DISALLOW_COPY_AND_ASSIGN(ContextProviderInProcess);
};
-} // namespace ui
+} // namespace android_webview
-#endif // WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_
+#endif // ANDROID_WEBVIEW_BROWSER_CONTEXT_PROVIDER_IN_PROCESS_H_

Powered by Google App Engine
This is Rietveld 408576698