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 3 // found in the LICENSE file. 4 5 #include "cc/test/mock_quad_culler.h" 6 7 #include "cc/quads/draw_quad.h" 8 9 namespace cc { 10 11 MockQuadCuller::MockQuadCuller() 12 : active_quad_list_(&quad_list_storage_), 13 active_shared_quad_state_list_(&shared_quad_state_storage_) {} 14 15 MockQuadCuller::MockQuadCuller( 16 QuadList* external_quad_list, 17 SharedQuadStateList* external_shared_quad_state_list) 18 : active_quad_list_(external_quad_list), 19 active_shared_quad_state_list_(external_shared_quad_state_list) {} 20 21 MockQuadCuller::~MockQuadCuller() {} 22 23 bool MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad, AppendQuadsData*) { 24 if (!draw_quad->rect.IsEmpty()) { 25 active_quad_list_->push_back(draw_quad.Pass()); 26 return true; 27 } 28 return false; 29 } 30 31 SharedQuadState* MockQuadCuller::UseSharedQuadState( 32 scoped_ptr<SharedQuadState> shared_quad_state) { 33 SharedQuadState* raw_ptr = shared_quad_state.get(); 34 active_shared_quad_state_list_->push_back(shared_quad_state.Pass()); 35 return raw_ptr; 36 } 37 38 } // namespace cc 39