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 #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_TEST_FAKE_GLES2_INTERFACE_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_TEST_FAKE_GLES2_INTERFACE_H_ 7 8 #include "gpu/command_buffer/client/gles2_interface_stub.h" 9 10 class FakeGLES2Interface : public gpu::gles2::GLES2InterfaceStub { 11 public: 12 // GLES2Interface implementation. GetGraphicsResetStatusKHR()13 GLenum GetGraphicsResetStatusKHR() override { 14 return context_lost_ ? GL_INVALID_OPERATION : GL_NO_ERROR; 15 } 16 17 // Methods for tests. SetIsContextLost(bool lost)18 void SetIsContextLost(bool lost) { context_lost_ = lost; } 19 20 private: 21 bool context_lost_ = false; 22 }; 23 24 #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_TEST_FAKE_GLES2_INTERFACE_H_ 25