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 20 matching lines...) Expand all Loading... |
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 "gpu/command_buffer/common/capabilities.h" |
35 #include "platform/RuntimeEnabledFeatures.h" | 35 #include "platform/RuntimeEnabledFeatures.h" |
36 #include "platform/graphics/ImageBuffer.h" | 36 #include "platform/graphics/ImageBuffer.h" |
37 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 37 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
38 #include "platform/graphics/gpu/Extensions3DUtil.h" | 38 #include "platform/graphics/gpu/Extensions3DUtil.h" |
39 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
40 #include "public/platform/WebExternalTextureMailbox.h" | 40 #include "public/platform/WebExternalTextureMailbox.h" |
41 #include "public/platform/WebGraphicsContext3D.h" | |
42 #include "public/platform/WebGraphicsContext3DProvider.h" | 41 #include "public/platform/WebGraphicsContext3DProvider.h" |
43 #include "public/platform/functional/WebFunction.h" | 42 #include "public/platform/functional/WebFunction.h" |
44 #include "testing/gmock/include/gmock/gmock.h" | 43 #include "testing/gmock/include/gmock/gmock.h" |
45 #include "testing/gtest/include/gtest/gtest.h" | 44 #include "testing/gtest/include/gtest/gtest.h" |
46 #include "wtf/RefPtr.h" | 45 #include "wtf/RefPtr.h" |
47 | 46 |
48 using testing::Test; | 47 using testing::Test; |
49 using testing::_; | 48 using testing::_; |
50 | 49 |
51 namespace blink { | 50 namespace blink { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 bool* m_live; | 233 bool* m_live; |
235 }; | 234 }; |
236 | 235 |
237 class WebGraphicsContext3DProviderForTests : public WebGraphicsContext3DProvider
{ | 236 class WebGraphicsContext3DProviderForTests : public WebGraphicsContext3DProvider
{ |
238 public: | 237 public: |
239 WebGraphicsContext3DProviderForTests(PassOwnPtr<gpu::gles2::GLES2Interface>
gl) | 238 WebGraphicsContext3DProviderForTests(PassOwnPtr<gpu::gles2::GLES2Interface>
gl) |
240 : m_gl(std::move(gl)) | 239 : m_gl(std::move(gl)) |
241 { | 240 { |
242 } | 241 } |
243 | 242 |
244 WebGraphicsContext3D* context3d() override { return nullptr; } | |
245 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } | 243 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } |
246 // Not used by WebGL code. | 244 // Not used by WebGL code. |
247 GrContext* grContext() override { return nullptr; } | 245 GrContext* grContext() override { return nullptr; } |
248 gpu::Capabilities getCapabilities() | 246 gpu::Capabilities getCapabilities() |
249 { | 247 { |
250 return gpu::Capabilities(); | 248 return gpu::Capabilities(); |
251 } | 249 } |
252 void setLostContextCallback(WebClosure) {} | 250 void setLostContextCallback(WebClosure) {} |
253 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {} | 251 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {} |
254 | 252 |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 m_drawingBuffer->markContentsChanged(); | 760 m_drawingBuffer->markContentsChanged(); |
763 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 761 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
764 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); | 762 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); |
765 EXPECT_FALSE(mailbox.allowOverlay); | 763 EXPECT_FALSE(mailbox.allowOverlay); |
766 | 764 |
767 m_drawingBuffer->mailboxReleased(mailbox, false); | 765 m_drawingBuffer->mailboxReleased(mailbox, false); |
768 m_drawingBuffer->beginDestruction(); | 766 m_drawingBuffer->beginDestruction(); |
769 } | 767 } |
770 | 768 |
771 } // namespace blink | 769 } // namespace blink |
OLD | NEW |