| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/graphics/gpu/DrawingBuffer.h" | 31 #include "platform/graphics/gpu/DrawingBuffer.h" |
| 32 | 32 |
| 33 #include "gpu/command_buffer/client/gles2_interface_stub.h" | 33 #include "gpu/command_buffer/client/gles2_interface_stub.h" |
| 34 #include "gpu/command_buffer/common/capabilities.h" |
| 34 #include "platform/RuntimeEnabledFeatures.h" | 35 #include "platform/RuntimeEnabledFeatures.h" |
| 35 #include "platform/graphics/ImageBuffer.h" | 36 #include "platform/graphics/ImageBuffer.h" |
| 36 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 37 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
| 37 #include "platform/graphics/gpu/Extensions3DUtil.h" | 38 #include "platform/graphics/gpu/Extensions3DUtil.h" |
| 38 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
| 39 #include "public/platform/WebExternalTextureMailbox.h" | 40 #include "public/platform/WebExternalTextureMailbox.h" |
| 40 #include "public/platform/WebGraphicsContext3D.h" | 41 #include "public/platform/WebGraphicsContext3D.h" |
| 41 #include "public/platform/WebGraphicsContext3DProvider.h" | 42 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 42 #include "public/platform/functional/WebFunction.h" | 43 #include "public/platform/functional/WebFunction.h" |
| 43 #include "testing/gmock/include/gmock/gmock.h" | 44 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 public: | 238 public: |
| 238 WebGraphicsContext3DProviderForTests(PassOwnPtr<gpu::gles2::GLES2Interface>
gl) | 239 WebGraphicsContext3DProviderForTests(PassOwnPtr<gpu::gles2::GLES2Interface>
gl) |
| 239 : m_gl(std::move(gl)) | 240 : m_gl(std::move(gl)) |
| 240 { | 241 { |
| 241 } | 242 } |
| 242 | 243 |
| 243 WebGraphicsContext3D* context3d() override { return nullptr; } | 244 WebGraphicsContext3D* context3d() override { return nullptr; } |
| 244 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } | 245 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } |
| 245 // Not used by WebGL code. | 246 // Not used by WebGL code. |
| 246 GrContext* grContext() override { return nullptr; } | 247 GrContext* grContext() override { return nullptr; } |
| 248 gpu::Capabilities getCapabilities() |
| 249 { |
| 250 return gpu::Capabilities(); |
| 251 } |
| 247 void setLostContextCallback(WebClosure) {} | 252 void setLostContextCallback(WebClosure) {} |
| 248 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {} | 253 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {} |
| 249 | 254 |
| 250 private: | 255 private: |
| 251 OwnPtr<gpu::gles2::GLES2Interface> m_gl; | 256 OwnPtr<gpu::gles2::GLES2Interface> m_gl; |
| 252 }; | 257 }; |
| 253 | 258 |
| 254 class DrawingBufferTest : public Test { | 259 class DrawingBufferTest : public Test { |
| 255 protected: | 260 protected: |
| 256 void SetUp() override | 261 void SetUp() override |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 m_drawingBuffer->markContentsChanged(); | 762 m_drawingBuffer->markContentsChanged(); |
| 758 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 763 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
| 759 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); | 764 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); |
| 760 EXPECT_FALSE(mailbox.allowOverlay); | 765 EXPECT_FALSE(mailbox.allowOverlay); |
| 761 | 766 |
| 762 m_drawingBuffer->mailboxReleased(mailbox, false); | 767 m_drawingBuffer->mailboxReleased(mailbox, false); |
| 763 m_drawingBuffer->beginDestruction(); | 768 m_drawingBuffer->beginDestruction(); |
| 764 } | 769 } |
| 765 | 770 |
| 766 } // namespace blink | 771 } // namespace blink |
| OLD | NEW |