Index: media/renderers/skcanvas_video_renderer_unittest.cc |
diff --git a/media/renderers/skcanvas_video_renderer_unittest.cc b/media/renderers/skcanvas_video_renderer_unittest.cc |
index df82f2740e2a9ec0cf1a1323035d7d117ee48c9c..8d949a83605102485fa5204def7a73b4c9ef1fd7 100644 |
--- a/media/renderers/skcanvas_video_renderer_unittest.cc |
+++ b/media/renderers/skcanvas_video_renderer_unittest.cc |
@@ -8,6 +8,7 @@ |
#include "base/message_loop/message_loop.h" |
#include "gpu/GLES2/gl2extchromium.h" |
#include "gpu/command_buffer/client/gles2_interface_stub.h" |
+#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" |
#include "media/base/timestamp_constants.h" |
#include "media/base/video_frame.h" |
#include "media/base/video_util.h" |
@@ -512,6 +513,18 @@ class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub { |
DCHECK_EQ(1, n); |
*textures = 1; |
} |
+ const GLubyte* GetString(GLenum name) override { |
+ switch (name) { |
+ case GL_EXTENSIONS: |
+ return reinterpret_cast<const GLubyte*>(""); |
+ case GL_SHADING_LANGUAGE_VERSION: |
+ return reinterpret_cast<const GLubyte*>("OpenGL ES GLSL ES 1.00"); |
+ case GL_VERSION: |
+ return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0"); |
+ default: |
+ return nullptr; |
+ } |
+ } |
}; |
void MailboxHoldersReleased(const gpu::SyncToken& sync_token) {} |
} // namespace |
@@ -519,16 +532,17 @@ void MailboxHoldersReleased(const gpu::SyncToken& sync_token) {} |
// Test that SkCanvasVideoRendererTest::Paint doesn't crash when GrContext is |
// abandoned. |
TEST_F(SkCanvasVideoRendererTest, ContextLost) { |
- skia::RefPtr<const GrGLInterface> null_interface = |
- skia::AdoptRef(GrGLCreateNullInterface()); |
+ SkCanvas canvas(AllocBitmap(kWidth, kHeight)); |
+ |
+ TestGLES2Interface gles2; |
+ |
+ skia::RefPtr<GrGLInterface> gl_interface = skia::AdoptRef(new GrGLInterface); |
+ skia_bindings::InitGLES2InterfaceBindings(gl_interface.get(), &gles2); |
auto gr_context = skia::AdoptRef(GrContext::Create( |
kOpenGL_GrBackend, |
- reinterpret_cast<GrBackendContext>(null_interface.get()))); |
+ reinterpret_cast<GrBackendContext>(gl_interface.get()))); |
gr_context->abandonContext(); |
- SkCanvas canvas(AllocBitmap(kWidth, kHeight)); |
- |
- TestGLES2Interface gles2; |
Context3D context_3d(&gles2, gr_context.get()); |
gfx::Size size(kWidth, kHeight); |
gpu::MailboxHolder mailbox(gpu::Mailbox::Generate(), gpu::SyncToken(), |