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

Side by Side Diff: cc/gl_renderer_unittest.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android!! Created 7 years, 11 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
« no previous file with comments | « cc/gl_renderer_pixeltest.cc ('k') | cc/keyframed_animation_curve.cc » ('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/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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 : m_hostImpl(&m_proxy) 65 : m_hostImpl(&m_proxy)
66 , m_setFullRootLayerDamageCount(0) 66 , m_setFullRootLayerDamageCount(0)
67 , m_lastCallWasSetVisibility(0) 67 , m_lastCallWasSetVisibility(0)
68 , m_rootLayer(LayerImpl::create(m_hostImpl.activeTree(), 1)) 68 , m_rootLayer(LayerImpl::create(m_hostImpl.activeTree(), 1))
69 , m_memoryAllocationLimitBytes(PrioritizedResourceManager::defaultMemory AllocationLimit()) 69 , m_memoryAllocationLimitBytes(PrioritizedResourceManager::defaultMemory AllocationLimit())
70 { 70 {
71 m_rootLayer->createRenderSurface(); 71 m_rootLayer->createRenderSurface();
72 RenderPass::Id renderPassId = m_rootLayer->renderSurface()->renderPassId (); 72 RenderPass::Id renderPassId = m_rootLayer->renderSurface()->renderPassId ();
73 scoped_ptr<RenderPass> rootRenderPass = RenderPass::Create(); 73 scoped_ptr<RenderPass> rootRenderPass = RenderPass::Create();
74 rootRenderPass->SetNew(renderPassId, gfx::Rect(), gfx::Rect(), gfx::Tran sform()); 74 rootRenderPass->SetNew(renderPassId, gfx::Rect(), gfx::Rect(), gfx::Tran sform());
75 m_renderPassesInDrawOrder.append(rootRenderPass.Pass()); 75 m_renderPassesInDrawOrder.push_back(rootRenderPass.Pass());
76 } 76 }
77 77
78 // RendererClient methods. 78 // RendererClient methods.
79 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { static gfx::S ize fakeSize(1, 1); return fakeSize; } 79 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { static gfx::S ize fakeSize(1, 1); return fakeSize; }
80 virtual const LayerTreeSettings& settings() const OVERRIDE { static LayerTre eSettings fakeSettings; return fakeSettings; } 80 virtual const LayerTreeSettings& settings() const OVERRIDE { static LayerTre eSettings fakeSettings; return fakeSettings; }
81 virtual void didLoseOutputSurface() OVERRIDE { } 81 virtual void didLoseOutputSurface() OVERRIDE { }
82 virtual void onSwapBuffersComplete() OVERRIDE { } 82 virtual void onSwapBuffersComplete() OVERRIDE { }
83 virtual void setFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCou nt++; } 83 virtual void setFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCou nt++; }
84 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; }
85 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; }
86 virtual bool hasImplThread() const OVERRIDE { return false; } 86 virtual bool hasImplThread() const OVERRIDE { return false; }
87 virtual bool shouldClearRootRenderPass() const OVERRIDE { return true; } 87 virtual bool shouldClearRootRenderPass() const OVERRIDE { return true; }
88 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const 88 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const
89 OVERRIDE { return CompositorFrameMetadata(); } 89 OVERRIDE { return CompositorFrameMetadata(); }
90 90
91 // Methods added for test. 91 // Methods added for test.
92 int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCou nt; } 92 int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCou nt; }
93 void setLastCallWasSetVisibilityPointer(bool* lastCallWasSetVisibility) { m_ lastCallWasSetVisibility = lastCallWasSetVisibility; } 93 void setLastCallWasSetVisibilityPointer(bool* lastCallWasSetVisibility) { m_ lastCallWasSetVisibility = lastCallWasSetVisibility; }
94 94
95 RenderPass* rootRenderPass() { return m_renderPassesInDrawOrder.last(); } 95 RenderPass* rootRenderPass() { return m_renderPassesInDrawOrder.back(); }
96 RenderPassList& renderPassesInDrawOrder() { return m_renderPassesInDrawOrder ; } 96 RenderPassList& renderPassesInDrawOrder() { return m_renderPassesInDrawOrder ; }
97 97
98 size_t memoryAllocationLimitBytes() const { return m_memoryAllocationLimitBy tes; } 98 size_t memoryAllocationLimitBytes() const { return m_memoryAllocationLimitBy tes; }
99 99
100 private: 100 private:
101 FakeImplProxy m_proxy; 101 FakeImplProxy m_proxy;
102 FakeLayerTreeHostImpl m_hostImpl; 102 FakeLayerTreeHostImpl m_hostImpl;
103 int m_setFullRootLayerDamageCount; 103 int m_setFullRootLayerDamageCount;
104 bool* m_lastCallWasSetVisibility; 104 bool* m_lastCallWasSetVisibility;
105 scoped_ptr<LayerImpl> m_rootLayer; 105 scoped_ptr<LayerImpl> m_rootLayer;
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 633
634 renderer.decideRenderPassAllocationsForFrame(mockClient.renderPassesInDrawOr der()); 634 renderer.decideRenderPassAllocationsForFrame(mockClient.renderPassesInDrawOr der());
635 renderer.drawFrame(mockClient.renderPassesInDrawOrder()); 635 renderer.drawFrame(mockClient.renderPassesInDrawOrder());
636 636
637 // In multiple render passes all but the root pass should clear the framebuf fer. 637 // In multiple render passes all but the root pass should clear the framebuf fer.
638 Mock::VerifyAndClearExpectations(&mockContext); 638 Mock::VerifyAndClearExpectations(&mockContext);
639 } 639 }
640 640
641 } // namespace 641 } // namespace
642 } // namespace cc 642 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer_pixeltest.cc ('k') | cc/keyframed_animation_curve.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698