| 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/quad_sink.h" | 8 #include "cc/quad_sink.h" |
| 8 #include "cc/render_pass.h" | 9 #include "cc/render_pass.h" |
| 9 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
| 10 #include "cc/solid_color_draw_quad.h" | 11 #include "cc/solid_color_draw_quad.h" |
| 11 #include "cc/test/animation_test_common.h" | 12 #include "cc/test/animation_test_common.h" |
| 12 #include "cc/test/fake_output_surface.h" | 13 #include "cc/test/fake_output_surface.h" |
| 13 #include "cc/test/fake_software_output_device.h" | 14 #include "cc/test/fake_software_output_device.h" |
| 14 #include "cc/test/geometry_test_utils.h" | 15 #include "cc/test/geometry_test_utils.h" |
| 15 #include "cc/test/render_pass_test_common.h" | 16 #include "cc/test/render_pass_test_common.h" |
| 16 #include "cc/tile_draw_quad.h" | 17 #include "cc/tile_draw_quad.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 39 | 40 |
| 40 // RendererClient implementation. | 41 // RendererClient implementation. |
| 41 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view
portSize; } | 42 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view
portSize; } |
| 42 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin
gs; } | 43 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin
gs; } |
| 43 virtual void didLoseOutputSurface() OVERRIDE { } | 44 virtual void didLoseOutputSurface() OVERRIDE { } |
| 44 virtual void onSwapBuffersComplete() OVERRIDE { } | 45 virtual void onSwapBuffersComplete() OVERRIDE { } |
| 45 virtual void setFullRootLayerDamage() OVERRIDE { } | 46 virtual void setFullRootLayerDamage() OVERRIDE { } |
| 46 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { }; | 47 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { }; |
| 47 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { }; | 48 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { }; |
| 48 virtual bool hasImplThread() const OVERRIDE { return false; } | 49 virtual bool hasImplThread() const OVERRIDE { return false; } |
| 50 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const |
| 51 OVERRIDE { return CompositorFrameMetadata(); } |
| 49 | 52 |
| 50 protected: | 53 protected: |
| 51 scoped_ptr<FakeOutputSurface> m_outputSurface; | 54 scoped_ptr<FakeOutputSurface> m_outputSurface; |
| 52 scoped_ptr<ResourceProvider> m_resourceProvider; | 55 scoped_ptr<ResourceProvider> m_resourceProvider; |
| 53 scoped_ptr<SoftwareRenderer> m_renderer; | 56 scoped_ptr<SoftwareRenderer> m_renderer; |
| 54 gfx::Size m_viewportSize; | 57 gfx::Size m_viewportSize; |
| 55 LayerTreeSettings m_settings; | 58 LayerTreeSettings m_settings; |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 TEST_F(SoftwareRendererTest, solidColorQuad) | 61 TEST_F(SoftwareRendererTest, solidColorQuad) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 renderer()->getFramebufferPixels(pixels.get(), outerRect); | 152 renderer()->getFramebufferPixels(pixels.get(), outerRect); |
| 150 | 153 |
| 151 EXPECT_EQ(SK_ColorYELLOW, pixels[0]); | 154 EXPECT_EQ(SK_ColorYELLOW, pixels[0]); |
| 152 EXPECT_EQ(SK_ColorYELLOW, pixels[outerPixels - 1]); | 155 EXPECT_EQ(SK_ColorYELLOW, pixels[outerPixels - 1]); |
| 153 EXPECT_EQ(SK_ColorCYAN, pixels[outerSize.width() + 1]); | 156 EXPECT_EQ(SK_ColorCYAN, pixels[outerSize.width() + 1]); |
| 154 EXPECT_EQ(SK_ColorCYAN, pixels[outerPixels - outerSize.width() - 2]); | 157 EXPECT_EQ(SK_ColorCYAN, pixels[outerPixels - outerSize.width() - 2]); |
| 155 } | 158 } |
| 156 | 159 |
| 157 } // namespace | 160 } // namespace |
| 158 } // namespace cc | 161 } // namespace cc |
| OLD | NEW |