Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: cc/software_renderer_unittest.cc

Issue 11316128: Send compositor frame IPC with metadata. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix compile errors on mac/win Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/renderer.h ('k') | cc/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/render_pass_test_utils.h" 17 #include "cc/test/render_pass_test_utils.h"
(...skipping 29 matching lines...) Expand all
46 // RendererClient implementation. 47 // RendererClient implementation.
47 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view portSize; } 48 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_view portSize; }
48 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin gs; } 49 virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settin gs; }
49 virtual void didLoseOutputSurface() OVERRIDE { } 50 virtual void didLoseOutputSurface() OVERRIDE { }
50 virtual void onSwapBuffersComplete() OVERRIDE { } 51 virtual void onSwapBuffersComplete() OVERRIDE { }
51 virtual void setFullRootLayerDamage() OVERRIDE { } 52 virtual void setFullRootLayerDamage() OVERRIDE { }
52 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR IDE { }; 53 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR IDE { };
53 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O VERRIDE { }; 54 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O VERRIDE { };
54 virtual bool hasImplThread() const OVERRIDE { return false; } 55 virtual bool hasImplThread() const OVERRIDE { return false; }
55 virtual bool shouldClearRootRenderPass() const OVERRIDE { return m_shouldCle arRootRenderPass; } 56 virtual bool shouldClearRootRenderPass() const OVERRIDE { return m_shouldCle arRootRenderPass; }
57 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const
58 OVERRIDE { return CompositorFrameMetadata(); }
56 59
57 protected: 60 protected:
58 scoped_ptr<FakeOutputSurface> m_outputSurface; 61 scoped_ptr<FakeOutputSurface> m_outputSurface;
59 scoped_ptr<ResourceProvider> m_resourceProvider; 62 scoped_ptr<ResourceProvider> m_resourceProvider;
60 scoped_ptr<SoftwareRenderer> m_renderer; 63 scoped_ptr<SoftwareRenderer> m_renderer;
61 gfx::Size m_viewportSize; 64 gfx::Size m_viewportSize;
62 LayerTreeSettings m_settings; 65 LayerTreeSettings m_settings;
63 bool m_shouldClearRootRenderPass; 66 bool m_shouldClearRootRenderPass;
64 }; 67 };
65 68
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // If we didn't clear, the borders should still be green. 214 // If we didn't clear, the borders should still be green.
212 EXPECT_EQ(SK_ColorGREEN, pixels[0]); 215 EXPECT_EQ(SK_ColorGREEN, pixels[0]);
213 EXPECT_EQ(SK_ColorGREEN, pixels[viewportPixels - 1]); 216 EXPECT_EQ(SK_ColorGREEN, pixels[viewportPixels - 1]);
214 217
215 EXPECT_EQ(SK_ColorMAGENTA, pixels[smallerRect.y() * viewportRect.width() + s mallerRect.x()]); 218 EXPECT_EQ(SK_ColorMAGENTA, pixels[smallerRect.y() * viewportRect.width() + s mallerRect.x()]);
216 EXPECT_EQ(SK_ColorMAGENTA, pixels[(smallerRect.bottom() - 1) * viewportRect. width() + smallerRect.right() - 1]); 219 EXPECT_EQ(SK_ColorMAGENTA, pixels[(smallerRect.bottom() - 1) * viewportRect. width() + smallerRect.right() - 1]);
217 } 220 }
218 221
219 } // namespace 222 } // namespace
220 } // namespace cc 223 } // namespace cc
OLDNEW
« no previous file with comments | « cc/renderer.h ('k') | cc/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698