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 #include "cc/gl_renderer.h" | 6 #include "cc/gl_renderer.h" |
7 | 7 |
8 #include "cc/draw_quad.h" | 8 #include "cc/draw_quad.h" |
9 #include "cc/prioritized_texture_manager.h" | 9 #include "cc/prioritized_texture_manager.h" |
10 #include "cc/resource_provider.h" | 10 #include "cc/resource_provider.h" |
11 #include "cc/settings.h" | 11 #include "cc/settings.h" |
12 #include "cc/single_thread_proxy.h" | 12 #include "cc/single_thread_proxy.h" |
13 #include "cc/test/fake_web_compositor_output_surface.h" | 13 #include "cc/test/fake_web_compositor_output_surface.h" |
14 #include "cc/test/fake_web_graphics_context_3d.h" | 14 #include "cc/test/fake_web_graphics_context_3d.h" |
15 #include "cc/test/test_common.h" | 15 #include "cc/test/test_common.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "third_party/khronos/GLES2/gl2.h" | 18 #include "third_party/khronos/GLES2/gl2.h" |
19 #include <public/WebTransformationMatrix.h> | 19 #include <public/WebTransformationMatrix.h> |
20 | 20 |
21 using namespace cc; | 21 using namespace cc; |
22 using namespace WebKit; | 22 using namespace WebKit; |
23 using namespace WebKitTests; | 23 using namespace WebKitTests; |
24 | 24 |
| 25 namespace { |
| 26 |
25 class FrameCountingMemoryAllocationSettingContext : public FakeWebGraphicsContex
t3D { | 27 class FrameCountingMemoryAllocationSettingContext : public FakeWebGraphicsContex
t3D { |
26 public: | 28 public: |
27 FrameCountingMemoryAllocationSettingContext() : m_frame(0) { } | 29 FrameCountingMemoryAllocationSettingContext() : m_frame(0) { } |
28 | 30 |
29 // WebGraphicsContext3D methods. | 31 // WebGraphicsContext3D methods. |
30 | 32 |
31 // This method would normally do a glSwapBuffers under the hood. | 33 // This method would normally do a glSwapBuffers under the hood. |
32 virtual void prepareTexture() { m_frame++; } | 34 virtual void prepareTexture() { m_frame++; } |
33 virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAll
ocationChangedCallbackCHROMIUM* callback) { m_memoryAllocationChangedCallback =
callback; } | 35 virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAll
ocationChangedCallbackCHROMIUM* callback) { m_memoryAllocationChangedCallback =
callback; } |
34 virtual WebString getString(WebKit::WGC3Denum name) | 36 virtual WebString getString(WebKit::WGC3Denum name) |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // process, after glFlush is called, and after the RendererClient's enforceM
anagedMemoryPolicy | 478 // process, after glFlush is called, and after the RendererClient's enforceM
anagedMemoryPolicy |
477 // is called. Plumb this tracking between both the RenderClient and the Cont
ext by giving | 479 // is called. Plumb this tracking between both the RenderClient and the Cont
ext by giving |
478 // them both a pointer to a variable on the stack. | 480 // them both a pointer to a variable on the stack. |
479 context->setLastCallWasSetVisibilityPointer(&lastCallWasSetVisiblity); | 481 context->setLastCallWasSetVisibilityPointer(&lastCallWasSetVisiblity); |
480 mockClient.setLastCallWasSetVisibilityPointer(&lastCallWasSetVisiblity); | 482 mockClient.setLastCallWasSetVisibilityPointer(&lastCallWasSetVisiblity); |
481 renderer.setVisible(true); | 483 renderer.setVisible(true); |
482 renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPa
sses()); | 484 renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPa
sses()); |
483 renderer.setVisible(false); | 485 renderer.setVisible(false); |
484 EXPECT_TRUE(lastCallWasSetVisiblity); | 486 EXPECT_TRUE(lastCallWasSetVisiblity); |
485 } | 487 } |
| 488 |
| 489 } // anonymous namespace |
OLD | NEW |