OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/texture_copier.h" | 5 #include "cc/texture_copier.h" |
6 | 6 |
7 #include "cc/test/fake_web_graphics_context_3d.h" | 7 #include "cc/test/test_web_graphics_context_3d.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/khronos/GLES2/gl2.h" | 10 #include "third_party/khronos/GLES2/gl2.h" |
11 | 11 |
12 using namespace WebKit; | 12 using namespace WebKit; |
13 using testing::InSequence; | 13 using testing::InSequence; |
14 using testing::Test; | 14 using testing::Test; |
15 using testing::_; | 15 using testing::_; |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 namespace { | 18 namespace { |
19 | 19 |
20 class MockContext : public FakeWebGraphicsContext3D { | 20 class MockContext : public TestWebGraphicsContext3D { |
21 public: | 21 public: |
22 MOCK_METHOD2(bindFramebuffer, void(WGC3Denum, WebGLId)); | 22 MOCK_METHOD2(bindFramebuffer, void(WGC3Denum, WebGLId)); |
23 MOCK_METHOD3(texParameteri, void(WGC3Denum target, WGC3Denum pname, WGC3Dint
param)); | 23 MOCK_METHOD3(texParameteri, void(WGC3Denum target, WGC3Denum pname, WGC3Dint
param)); |
24 MOCK_METHOD1(disable, void(WGC3Denum cap)); | 24 MOCK_METHOD1(disable, void(WGC3Denum cap)); |
25 MOCK_METHOD1(enable, void(WGC3Denum cap)); | 25 MOCK_METHOD1(enable, void(WGC3Denum cap)); |
26 | 26 |
27 MOCK_METHOD3(drawArrays, void(WGC3Denum mode, WGC3Dint first, WGC3Dsizei cou
nt)); | 27 MOCK_METHOD3(drawArrays, void(WGC3Denum mode, WGC3Dint first, WGC3Dsizei cou
nt)); |
28 }; | 28 }; |
29 | 29 |
30 TEST(TextureCopierTest, testDrawArraysCopy) | 30 TEST(TextureCopierTest, testDrawArraysCopy) |
(...skipping 26 matching lines...) Expand all Loading... |
57 int sourceTextureId = mockContext->createTexture(); | 57 int sourceTextureId = mockContext->createTexture(); |
58 int destTextureId = mockContext->createTexture(); | 58 int destTextureId = mockContext->createTexture(); |
59 gfx::Size size(256, 128); | 59 gfx::Size size(256, 128); |
60 scoped_ptr<AcceleratedTextureCopier> copier(AcceleratedTextureCopier::create
(mockContext.get(), false)); | 60 scoped_ptr<AcceleratedTextureCopier> copier(AcceleratedTextureCopier::create
(mockContext.get(), false)); |
61 TextureCopier::Parameters copy = { sourceTextureId, destTextureId, size }; | 61 TextureCopier::Parameters copy = { sourceTextureId, destTextureId, size }; |
62 copier->copyTexture(copy); | 62 copier->copyTexture(copy); |
63 } | 63 } |
64 | 64 |
65 } // namespace | 65 } // namespace |
66 } // namespace cc | 66 } // namespace cc |
OLD | NEW |