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

Side by Side Diff: cc/output/software_renderer_unittest.cc

Issue 12545018: Move context-related callbacks into OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: suppress lost context notification before renderer initialized Created 7 years, 9 months 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 | Annotate | Revision Log
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/output/software_renderer.h" 5 #include "cc/output/software_renderer.h"
6 6
7 #include "cc/layers/quad_sink.h" 7 #include "cc/layers/quad_sink.h"
8 #include "cc/output/compositor_frame_metadata.h" 8 #include "cc/output/compositor_frame_metadata.h"
9 #include "cc/output/software_output_device.h" 9 #include "cc/output/software_output_device.h"
10 #include "cc/quads/render_pass.h" 10 #include "cc/quads/render_pass.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 ResourceProvider* resourceProvider() const { return resource_provider_.get() ; } 40 ResourceProvider* resourceProvider() const { return resource_provider_.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 gfx::Size DeviceViewportSize() const OVERRIDE { return m_viewportSiz e; } 46 virtual gfx::Size DeviceViewportSize() const OVERRIDE { return m_viewportSiz e; }
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698