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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gpu/command_buffer/client/gles2_interface.h"
6 #include "gpu/command_buffer/common/capabilities.h"
7 #include "public/platform/WebGraphicsContext3DProvider.h"
8 #include "third_party/skia/include/gpu/GrContext.h"
9 #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
10 #include "wtf/RefPtr.h"
11
12 namespace blink {
13
14 class FakeWebGraphicsContext3DProvider : public WebGraphicsContext3DProvider {
15 public:
16 FakeWebGraphicsContext3DProvider(gpu::gles2::GLES2Interface* gl)
17 : m_gl(gl)
18 {
19 RefPtr<const GrGLInterface> glInterface = adoptRef(GrGLCreateNullInterfa ce());
20 m_grContext = adoptRef(GrContext::Create(kOpenGL_GrBackend, reinterpret_ cast<GrBackendContext>(glInterface.get())));
21 }
22
23 GrContext* grContext() override
24 {
25 return m_grContext.get();
26 }
27
28 gpu::Capabilities getCapabilities()
29 {
30 return gpu::Capabilities();
31 }
32
33 gpu::gles2::GLES2Interface* contextGL() override
34 {
35 return m_gl;
36 }
37
38 bool bindToCurrentThread() override { return false; }
39 void setLostContextCallback(WebClosure) override {}
40 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {}
41
42 private:
43 gpu::gles2::GLES2Interface* m_gl;
44 RefPtr<GrContext> m_grContext;
45 };
46
47 } // namespace blink
OLDNEW
« 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