| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 std::unique_ptr<gpu::gles2::GLES2Interface> m_gl; | 43 std::unique_ptr<gpu::gles2::GLES2Interface> m_gl; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class DrawingBufferSoftwareRenderingTest : public Test { | 46 class DrawingBufferSoftwareRenderingTest : public Test { |
| 47 protected: | 47 protected: |
| 48 void SetUp() override { | 48 void SetUp() override { |
| 49 IntSize initialSize(InitialWidth, InitialHeight); | 49 IntSize initialSize(InitialWidth, InitialHeight); |
| 50 std::unique_ptr<GLES2InterfaceForTests> gl = | 50 std::unique_ptr<GLES2InterfaceForTests> gl = |
| 51 wrapUnique(new GLES2InterfaceForTests); | 51 WTF::wrapUnique(new GLES2InterfaceForTests); |
| 52 std::unique_ptr<WebGraphicsContext3DProviderSoftwareRenderingForTests> | 52 std::unique_ptr<WebGraphicsContext3DProviderSoftwareRenderingForTests> |
| 53 provider = wrapUnique( | 53 provider = WTF::wrapUnique( |
| 54 new WebGraphicsContext3DProviderSoftwareRenderingForTests( | 54 new WebGraphicsContext3DProviderSoftwareRenderingForTests( |
| 55 std::move(gl))); | 55 std::move(gl))); |
| 56 m_drawingBuffer = DrawingBufferForTests::create( | 56 m_drawingBuffer = DrawingBufferForTests::create( |
| 57 std::move(provider), nullptr, initialSize, DrawingBuffer::Preserve); | 57 std::move(provider), nullptr, initialSize, DrawingBuffer::Preserve); |
| 58 CHECK(m_drawingBuffer); | 58 CHECK(m_drawingBuffer); |
| 59 } | 59 } |
| 60 | 60 |
| 61 RefPtr<DrawingBufferForTests> m_drawingBuffer; | 61 RefPtr<DrawingBufferForTests> m_drawingBuffer; |
| 62 bool m_isSoftwareRendering = false; | 62 bool m_isSoftwareRendering = false; |
| 63 }; | 63 }; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 &releaseCallback3); // cause recycling queue to be purged due to resize | 95 &releaseCallback3); // cause recycling queue to be purged due to resize |
| 96 EXPECT_EQ(0, m_drawingBuffer->recycledBitmapCount()); | 96 EXPECT_EQ(0, m_drawingBuffer->recycledBitmapCount()); |
| 97 releaseCallback3->Run(gpu::SyncToken(), false /* lostResource */); | 97 releaseCallback3->Run(gpu::SyncToken(), false /* lostResource */); |
| 98 EXPECT_EQ(1, m_drawingBuffer->recycledBitmapCount()); | 98 EXPECT_EQ(1, m_drawingBuffer->recycledBitmapCount()); |
| 99 | 99 |
| 100 m_drawingBuffer->beginDestruction(); | 100 m_drawingBuffer->beginDestruction(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // unnamed namespace | 103 } // unnamed namespace |
| 104 } // blink | 104 } // blink |
| OLD | NEW |