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 "cc/software_renderer.h" | 5 #include "cc/software_renderer.h" |
6 | 6 |
7 #include "cc/compositor_frame_metadata.h" | 7 #include "cc/compositor_frame_metadata.h" |
8 #include "cc/quad_sink.h" | 8 #include "cc/quad_sink.h" |
9 #include "cc/render_pass.h" | 9 #include "cc/render_pass.h" |
10 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } | 40 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } |
41 SoftwareRenderer* renderer() const { return m_renderer.get(); } | 41 SoftwareRenderer* renderer() const { return m_renderer.get(); } |
42 void setViewportSize(const gfx::Size& viewportSize) { m_viewportSize = viewp
ortSize; } | 42 void setViewportSize(const gfx::Size& viewportSize) { m_viewportSize = viewp
ortSize; } |
43 void setShouldClearRootRenderPass(bool clearRootRenderPass) { m_shouldClearR
ootRenderPass = clearRootRenderPass; } | 43 void setShouldClearRootRenderPass(bool clearRootRenderPass) { m_shouldClearR
ootRenderPass = clearRootRenderPass; } |
44 | 44 |
45 // RendererClient implementation. | 45 // RendererClient implementation. |
46 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view
portSize; } | 46 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view
portSize; } |
47 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin
gs; } | 47 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin
gs; } |
48 virtual void didLoseOutputSurface() OVERRIDE { } | |
49 virtual void onSwapBuffersComplete() OVERRIDE { } | |
50 virtual void setFullRootLayerDamage() OVERRIDE { } | 48 virtual void setFullRootLayerDamage() OVERRIDE { } |
51 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { }; | 49 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { }; |
52 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { }; | 50 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { }; |
53 virtual bool hasImplThread() const OVERRIDE { return false; } | 51 virtual bool hasImplThread() const OVERRIDE { return false; } |
54 virtual bool shouldClearRootRenderPass() const OVERRIDE { return m_shouldCle
arRootRenderPass; } | 52 virtual bool shouldClearRootRenderPass() const OVERRIDE { return m_shouldCle
arRootRenderPass; } |
55 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const | 53 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const |
56 OVERRIDE { return CompositorFrameMetadata(); } | 54 OVERRIDE { return CompositorFrameMetadata(); } |
57 | 55 |
58 protected: | 56 protected: |
59 scoped_ptr<FakeOutputSurface> m_outputSurface; | 57 scoped_ptr<FakeOutputSurface> m_outputSurface; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // If we didn't clear, the borders should still be green. | 196 // If we didn't clear, the borders should still be green. |
199 EXPECT_EQ(SK_ColorGREEN, pixels[0]); | 197 EXPECT_EQ(SK_ColorGREEN, pixels[0]); |
200 EXPECT_EQ(SK_ColorGREEN, pixels[viewportPixels - 1]); | 198 EXPECT_EQ(SK_ColorGREEN, pixels[viewportPixels - 1]); |
201 | 199 |
202 EXPECT_EQ(SK_ColorMAGENTA, pixels[smallerRect.y() * viewportRect.width() + s
mallerRect.x()]); | 200 EXPECT_EQ(SK_ColorMAGENTA, pixels[smallerRect.y() * viewportRect.width() + s
mallerRect.x()]); |
203 EXPECT_EQ(SK_ColorMAGENTA, pixels[(smallerRect.bottom() - 1) * viewportRect.
width() + smallerRect.right() - 1]); | 201 EXPECT_EQ(SK_ColorMAGENTA, pixels[(smallerRect.bottom() - 1) * viewportRect.
width() + smallerRect.right() - 1]); |
204 } | 202 } |
205 | 203 |
206 } // namespace | 204 } // namespace |
207 } // namespace cc | 205 } // namespace cc |
OLD | NEW |