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

Unified Diff: third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h

Issue 2123623002: Reland: Make 2D canvas disable gpu acceleration when getImageData is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 5 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 | « third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h
diff --git a/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f30369016ce9c4cefd31a53636c3718b82f530c
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h
@@ -0,0 +1,47 @@
+// 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.
+
+#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/capabilities.h"
+#include "public/platform/WebGraphicsContext3DProvider.h"
+#include "third_party/skia/include/gpu/GrContext.h"
+#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+
+class FakeWebGraphicsContext3DProvider : public WebGraphicsContext3DProvider {
+public:
+ FakeWebGraphicsContext3DProvider(gpu::gles2::GLES2Interface* gl)
+ : m_gl(gl)
+ {
+ RefPtr<const GrGLInterface> glInterface = adoptRef(GrGLCreateNullInterface());
+ m_grContext = adoptRef(GrContext::Create(kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(glInterface.get())));
+ }
+
+ GrContext* grContext() override
+ {
+ return m_grContext.get();
+ }
+
+ gpu::Capabilities getCapabilities()
+ {
+ return gpu::Capabilities();
+ }
+
+ gpu::gles2::GLES2Interface* contextGL() override
+ {
+ return m_gl;
+ }
+
+ bool bindToCurrentThread() override { return false; }
+ void setLostContextCallback(WebClosure) override {}
+ void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {}
+
+private:
+ gpu::gles2::GLES2Interface* m_gl;
+ RefPtr<GrContext> m_grContext;
+};
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698