| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quads/list_container.h" | 5 #include "cc/quads/list_container.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/base/scoped_ptr_vector.h" | 10 #include "cc/base/scoped_ptr_vector.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 break; | 426 break; |
| 427 index -= current_size; | 427 index -= current_size; |
| 428 } | 428 } |
| 429 return *Iterator(data_.get(), | 429 return *Iterator(data_.get(), |
| 430 list_index, | 430 list_index, |
| 431 data_->InnerListById(list_index)->ElementAt(index), | 431 data_->InnerListById(list_index)->ElementAt(index), |
| 432 original_index); | 432 original_index); |
| 433 } | 433 } |
| 434 | 434 |
| 435 template <typename BaseElementType> | 435 template <typename BaseElementType> |
| 436 BaseElementType* ListContainer<BaseElementType>::Allocate( | 436 void* ListContainer<BaseElementType>::Allocate( |
| 437 size_t size_of_actual_element_in_bytes) { | 437 size_t size_of_actual_element_in_bytes) { |
| 438 DCHECK_LE(size_of_actual_element_in_bytes, data_->element_size()); | 438 DCHECK_LE(size_of_actual_element_in_bytes, data_->element_size()); |
| 439 void* result = data_->Allocate(); | 439 return data_->Allocate(); |
| 440 return static_cast<BaseElementType*>(result); | |
| 441 } | 440 } |
| 442 | 441 |
| 443 template <typename BaseElementType> | 442 template <typename BaseElementType> |
| 444 size_t ListContainer<BaseElementType>::size() const { | 443 size_t ListContainer<BaseElementType>::size() const { |
| 445 return data_->size(); | 444 return data_->size(); |
| 446 } | 445 } |
| 447 | 446 |
| 448 template <typename BaseElementType> | 447 template <typename BaseElementType> |
| 449 bool ListContainer<BaseElementType>::empty() const { | 448 bool ListContainer<BaseElementType>::empty() const { |
| 450 return data_->IsEmpty(); | 449 return data_->IsEmpty(); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 674 |
| 676 template <typename BaseElementType> | 675 template <typename BaseElementType> |
| 677 size_t ListContainer<BaseElementType>::ConstReverseIterator::index() const { | 676 size_t ListContainer<BaseElementType>::ConstReverseIterator::index() const { |
| 678 return index_; | 677 return index_; |
| 679 } | 678 } |
| 680 | 679 |
| 681 template class ListContainer<SharedQuadState>; | 680 template class ListContainer<SharedQuadState>; |
| 682 template class ListContainer<DrawQuad>; | 681 template class ListContainer<DrawQuad>; |
| 683 | 682 |
| 684 } // namespace cc | 683 } // namespace cc |
| OLD | NEW |