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/quad_sink.h" | 7 #include "cc/quad_sink.h" |
8 #include "cc/render_pass.h" | 8 #include "cc/render_pass.h" |
9 #include "cc/render_pass_draw_quad.h" | 9 #include "cc/render_pass_draw_quad.h" |
10 #include "cc/solid_color_draw_quad.h" | 10 #include "cc/solid_color_draw_quad.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 WebCompositorSoftwareOutputDevice* softwareDevice() const { return m_outputS
urface->softwareDevice(); } | 34 WebCompositorSoftwareOutputDevice* softwareDevice() const { return m_outputS
urface->softwareDevice(); } |
35 FakeWebCompositorOutputSurface* outputSurface() const { return m_outputSurfa
ce.get(); } | 35 FakeWebCompositorOutputSurface* outputSurface() const { return m_outputSurfa
ce.get(); } |
36 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } | 36 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } |
37 SoftwareRenderer* renderer() const { return m_renderer.get(); } | 37 SoftwareRenderer* renderer() const { return m_renderer.get(); } |
38 void setViewportSize(gfx::Size viewportSize) { m_viewportSize = viewportSize
; } | 38 void setViewportSize(gfx::Size viewportSize) { m_viewportSize = viewportSize
; } |
39 | 39 |
40 // RendererClient implementation. | 40 // RendererClient implementation. |
41 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view
portSize; } | 41 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view
portSize; } |
42 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin
gs; } | 42 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin
gs; } |
43 virtual void didLoseOutputSurface() OVERRIDE { } | 43 virtual void didLoseContext() OVERRIDE { } |
44 virtual void onSwapBuffersComplete() OVERRIDE { } | 44 virtual void onSwapBuffersComplete() OVERRIDE { } |
45 virtual void setFullRootLayerDamage() OVERRIDE { } | 45 virtual void setFullRootLayerDamage() OVERRIDE { } |
46 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { }; | 46 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { }; |
47 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { }; | 47 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { }; |
48 virtual bool hasImplThread() const OVERRIDE { return false; } | 48 virtual bool hasImplThread() const OVERRIDE { return false; } |
49 | 49 |
50 protected: | 50 protected: |
51 scoped_ptr<FakeWebCompositorOutputSurface> m_outputSurface; | 51 scoped_ptr<FakeWebCompositorOutputSurface> m_outputSurface; |
52 scoped_ptr<ResourceProvider> m_resourceProvider; | 52 scoped_ptr<ResourceProvider> m_resourceProvider; |
53 scoped_ptr<SoftwareRenderer> m_renderer; | 53 scoped_ptr<SoftwareRenderer> m_renderer; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 renderer()->getFramebufferPixels(pixels.get(), outerRect); | 149 renderer()->getFramebufferPixels(pixels.get(), outerRect); |
150 | 150 |
151 EXPECT_EQ(SK_ColorYELLOW, pixels[0]); | 151 EXPECT_EQ(SK_ColorYELLOW, pixels[0]); |
152 EXPECT_EQ(SK_ColorYELLOW, pixels[outerPixels - 1]); | 152 EXPECT_EQ(SK_ColorYELLOW, pixels[outerPixels - 1]); |
153 EXPECT_EQ(SK_ColorCYAN, pixels[outerSize.width() + 1]); | 153 EXPECT_EQ(SK_ColorCYAN, pixels[outerSize.width() + 1]); |
154 EXPECT_EQ(SK_ColorCYAN, pixels[outerPixels - outerSize.width() - 2]); | 154 EXPECT_EQ(SK_ColorCYAN, pixels[outerPixels - outerSize.width() - 2]); |
155 } | 155 } |
156 | 156 |
157 } // namespace | 157 } // namespace |
158 } // namespace cc | 158 } // namespace cc |
OLD | NEW |