| 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.
|
|
|