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

Unified Diff: webkit/support/test_webkit_platform_support.cc

Issue 12217099: Implement the Platform::sharedOffscreenGraphicsContext3D method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no factory member vars Created 7 years, 10 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 | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/test_webkit_platform_support.cc
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index cb79b7e00f04bb72105c34591c02c116d1877446..b5560365fa7b9379b5fe8a5fb909d5aa69874379 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -12,6 +12,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "cc/context_provider.h"
#include "cc/thread_impl.h"
#include "media/base/media.h"
#include "net/cookies/cookie_monster.h"
@@ -41,6 +42,7 @@
#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webkitplatformsupport_impl.h"
+#include "webkit/gpu/test_context_provider_factory.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
#include "webkit/plugins/npapi/plugin_list.h"
@@ -378,6 +380,24 @@ TestWebKitPlatformSupport::createOffscreenGraphicsContext3D(
return NULL;
}
+WebKit::WebGraphicsContext3D*
+TestWebKitPlatformSupport::sharedOffscreenGraphicsContext3D() {
+ main_thread_contexts_ =
+ webkit::gpu::TestContextProviderFactory::GetInstance()->
+ OffscreenContextProviderForMainThread();
+ if (!main_thread_contexts_->InitializeOnMainThread())
+ return NULL;
+ if (!main_thread_contexts_->BindToCurrentThread())
+ return NULL;
+ return main_thread_contexts_->Context3d();
+}
+
+GrContext* TestWebKitPlatformSupport::sharedOffscreenGrContext() {
+ if (!main_thread_contexts_)
+ return NULL;
+ return main_thread_contexts_->GrContext();
+}
+
bool TestWebKitPlatformSupport::canAccelerate2dCanvas() {
// We supply an OS-MESA based context for accelarated 2d
// canvas, which should always work.
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698