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

Side by Side Diff: cc/gl_renderer_unittest.cc

Issue 12545018: Move context-related callbacks into OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: works 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/gl_renderer.h" 5 #include "cc/gl_renderer.h"
6 6
7 #include "cc/compositor_frame_metadata.h" 7 #include "cc/compositor_frame_metadata.h"
8 #include "cc/draw_quad.h" 8 #include "cc/draw_quad.h"
9 #include "cc/prioritized_resource_manager.h" 9 #include "cc/prioritized_resource_manager.h"
10 #include "cc/resource_provider.h" 10 #include "cc/resource_provider.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 m_rootLayer->CreateRenderSurface(); 73 m_rootLayer->CreateRenderSurface();
74 RenderPass::Id renderPassId = m_rootLayer->render_surface()->RenderPassI d(); 74 RenderPass::Id renderPassId = m_rootLayer->render_surface()->RenderPassI d();
75 scoped_ptr<RenderPass> root_render_pass = RenderPass::Create(); 75 scoped_ptr<RenderPass> root_render_pass = RenderPass::Create();
76 root_render_pass->SetNew(renderPassId, gfx::Rect(), gfx::Rect(), gfx::Tr ansform()); 76 root_render_pass->SetNew(renderPassId, gfx::Rect(), gfx::Rect(), gfx::Tr ansform());
77 m_renderPassesInDrawOrder.push_back(root_render_pass.Pass()); 77 m_renderPassesInDrawOrder.push_back(root_render_pass.Pass());
78 } 78 }
79 79
80 // RendererClient methods. 80 // RendererClient methods.
81 virtual gfx::Size DeviceViewportSize() const OVERRIDE { static gfx::Size fak eSize(1, 1); return fakeSize; } 81 virtual gfx::Size DeviceViewportSize() const OVERRIDE { static gfx::Size fak eSize(1, 1); return fakeSize; }
82 virtual const LayerTreeSettings& Settings() const OVERRIDE { static LayerTre eSettings fakeSettings; return fakeSettings; } 82 virtual const LayerTreeSettings& Settings() const OVERRIDE { static LayerTre eSettings fakeSettings; return fakeSettings; }
83 virtual void DidLoseOutputSurface() OVERRIDE { }
84 virtual void OnSwapBuffersComplete() OVERRIDE { }
85 virtual void SetFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCou nt++; } 83 virtual void SetFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCou nt++; }
86 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR IDE { m_memoryAllocationLimitBytes = policy.bytesLimitWhenVisible; } 84 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR IDE { m_memoryAllocationLimitBytes = policy.bytesLimitWhenVisible; }
87 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O VERRIDE { if (m_lastCallWasSetVisibility) *m_lastCallWasSetVisibility = false; } 85 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O VERRIDE { if (m_lastCallWasSetVisibility) *m_lastCallWasSetVisibility = false; }
88 virtual bool HasImplThread() const OVERRIDE { return false; } 86 virtual bool HasImplThread() const OVERRIDE { return false; }
89 virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } 87 virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; }
90 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const 88 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const
91 OVERRIDE { return CompositorFrameMetadata(); } 89 OVERRIDE { return CompositorFrameMetadata(); }
92 90
93 // Methods added for test. 91 // Methods added for test.
94 int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCou nt; } 92 int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCou nt; }
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 821
824 TEST_F(MockOutputSurfaceTestWithSendCompositorFrame, DrawFrame) 822 TEST_F(MockOutputSurfaceTestWithSendCompositorFrame, DrawFrame)
825 { 823 {
826 EXPECT_CALL(m_outputSurface, SendFrameToParentCompositor(_)) 824 EXPECT_CALL(m_outputSurface, SendFrameToParentCompositor(_))
827 .Times(1); 825 .Times(1);
828 DrawFrame(); 826 DrawFrame();
829 } 827 }
830 828
831 } // namespace 829 } // namespace
832 } // namespace cc 830 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698