| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/gpu/DrawingBuffer.h" | 5 #include "platform/graphics/gpu/DrawingBuffer.h" |
| 6 | 6 |
| 7 #include "cc/resources/single_release_callback.h" | 7 #include "cc/resources/single_release_callback.h" |
| 8 #include "cc/resources/texture_mailbox.h" | 8 #include "cc/resources/texture_mailbox.h" |
| 9 #include "gpu/command_buffer/client/gles2_interface_stub.h" | 9 #include "gpu/command_buffer/client/gles2_interface_stub.h" |
| 10 #include "platform/graphics/gpu/DrawingBufferTestHelpers.h" | 10 #include "platform/graphics/gpu/DrawingBufferTestHelpers.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } | 30 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } |
| 31 bool isSoftwareRendering() const override { return true; } | 31 bool isSoftwareRendering() const override { return true; } |
| 32 | 32 |
| 33 // Not used by WebGL code. | 33 // Not used by WebGL code. |
| 34 GrContext* grContext() override { return nullptr; } | 34 GrContext* grContext() override { return nullptr; } |
| 35 bool bindToCurrentThread() override { return false; } | 35 bool bindToCurrentThread() override { return false; } |
| 36 gpu::Capabilities getCapabilities() override { return gpu::Capabilities(); } | 36 gpu::Capabilities getCapabilities() override { return gpu::Capabilities(); } |
| 37 void setLostContextCallback(const base::Closure&) {} | 37 void setLostContextCallback(const base::Closure&) {} |
| 38 void setErrorMessageCallback( | 38 void setErrorMessageCallback( |
| 39 const base::Callback<void(const char*, int32_t id)>&) {} | 39 const base::Callback<void(const char*, int32_t id)>&) {} |
| 40 void signalQuery(uint32_t, const base::Closure&) override {} |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 std::unique_ptr<gpu::gles2::GLES2Interface> m_gl; | 43 std::unique_ptr<gpu::gles2::GLES2Interface> m_gl; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 class DrawingBufferSoftwareRenderingTest : public Test { | 46 class DrawingBufferSoftwareRenderingTest : public Test { |
| 46 protected: | 47 protected: |
| 47 void SetUp() override { | 48 void SetUp() override { |
| 48 IntSize initialSize(InitialWidth, InitialHeight); | 49 IntSize initialSize(InitialWidth, InitialHeight); |
| 49 std::unique_ptr<GLES2InterfaceForTests> gl = | 50 std::unique_ptr<GLES2InterfaceForTests> gl = |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 &releaseCallback3); // cause recycling queue to be purged due to resize | 95 &releaseCallback3); // cause recycling queue to be purged due to resize |
| 95 EXPECT_EQ(0, m_drawingBuffer->recycledBitmapCount()); | 96 EXPECT_EQ(0, m_drawingBuffer->recycledBitmapCount()); |
| 96 releaseCallback3->Run(gpu::SyncToken(), false /* lostResource */); | 97 releaseCallback3->Run(gpu::SyncToken(), false /* lostResource */); |
| 97 EXPECT_EQ(1, m_drawingBuffer->recycledBitmapCount()); | 98 EXPECT_EQ(1, m_drawingBuffer->recycledBitmapCount()); |
| 98 | 99 |
| 99 m_drawingBuffer->beginDestruction(); | 100 m_drawingBuffer->beginDestruction(); |
| 100 } | 101 } |
| 101 | 102 |
| 102 } // unnamed namespace | 103 } // unnamed namespace |
| 103 } // blink | 104 } // blink |
| OLD | NEW |