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