OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/throttled_texture_uploader.h" | 7 #include "cc/throttled_texture_uploader.h" |
8 | 8 |
9 #include "CCPrioritizedTexture.h" | 9 #include "CCPrioritizedTexture.h" |
10 #include "Extensions3DChromium.h" | |
11 #include "GraphicsContext3D.h" | |
12 #include "cc/test/fake_web_graphics_context_3d.h" | 10 #include "cc/test/fake_web_graphics_context_3d.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/khronos/GLES2/gl2.h" |
| 14 #include "third_party/khronos/GLES2/gl2ext.h" |
15 | 15 |
16 using namespace cc; | 16 using namespace cc; |
17 using namespace WebKit; | 17 using namespace WebKit; |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 class FakeWebGraphicsContext3DWithQueryTesting : public FakeWebGraphicsContext3D
{ | 21 class FakeWebGraphicsContext3DWithQueryTesting : public FakeWebGraphicsContext3D
{ |
22 public: | 22 public: |
23 FakeWebGraphicsContext3DWithQueryTesting() : m_resultAvailable(0) | 23 FakeWebGraphicsContext3DWithQueryTesting() : m_resultAvailable(0) |
24 { | 24 { |
25 } | 25 } |
26 | 26 |
27 virtual void getQueryObjectuivEXT(WebGLId, GC3Denum type, GC3Duint* value) | 27 virtual void getQueryObjectuivEXT(WebGLId, WGC3Denum type, WGC3Duint* value) |
28 { | 28 { |
29 switch (type) { | 29 switch (type) { |
30 case Extensions3DChromium::QUERY_RESULT_AVAILABLE_EXT: | 30 case GL_QUERY_RESULT_AVAILABLE_EXT: |
31 *value = m_resultAvailable; | 31 *value = m_resultAvailable; |
32 break; | 32 break; |
33 default: | 33 default: |
34 *value = 0; | 34 *value = 0; |
35 break; | 35 break; |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resu
ltAvailable; } | 39 void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resu
ltAvailable; } |
40 | 40 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 EXPECT_EQ(1, uploader->numBlockingUploads()); | 95 EXPECT_EQ(1, uploader->numBlockingUploads()); |
96 | 96 |
97 fakeContext->setResultAvailable(1); | 97 fakeContext->setResultAvailable(1); |
98 EXPECT_EQ(0, uploader->numBlockingUploads()); | 98 EXPECT_EQ(0, uploader->numBlockingUploads()); |
99 uploadTexture(uploader.get(), texture.get()); | 99 uploadTexture(uploader.get(), texture.get()); |
100 uploader->markPendingUploadsAsNonBlocking(); | 100 uploader->markPendingUploadsAsNonBlocking(); |
101 EXPECT_EQ(0, uploader->numBlockingUploads()); | 101 EXPECT_EQ(0, uploader->numBlockingUploads()); |
102 } | 102 } |
103 | 103 |
104 } // namespace | 104 } // namespace |
OLD | NEW |