OLD | NEW |
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/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 DCHECK(gl); | 1095 DCHECK(gl); |
1096 #if DCHECK_IS_ON | 1096 #if DCHECK_IS_ON |
1097 // Check that all GL resources has been deleted. | 1097 // Check that all GL resources has been deleted. |
1098 for (ResourceMap::const_iterator itr = resources_.begin(); | 1098 for (ResourceMap::const_iterator itr = resources_.begin(); |
1099 itr != resources_.end(); | 1099 itr != resources_.end(); |
1100 ++itr) { | 1100 ++itr) { |
1101 DCHECK_NE(GLTexture, itr->second.type); | 1101 DCHECK_NE(GLTexture, itr->second.type); |
1102 } | 1102 } |
1103 #endif // DCHECK_IS_ON | 1103 #endif // DCHECK_IS_ON |
1104 | 1104 |
1105 texture_uploader_.reset(); | 1105 texture_uploader_ = nullptr; |
1106 texture_id_allocator_.reset(); | 1106 texture_id_allocator_ = nullptr; |
1107 buffer_id_allocator_.reset(); | 1107 buffer_id_allocator_ = nullptr; |
1108 gl->Finish(); | 1108 gl->Finish(); |
1109 } | 1109 } |
1110 | 1110 |
1111 int ResourceProvider::CreateChild(const ReturnCallback& return_callback) { | 1111 int ResourceProvider::CreateChild(const ReturnCallback& return_callback) { |
1112 DCHECK(thread_checker_.CalledOnValidThread()); | 1112 DCHECK(thread_checker_.CalledOnValidThread()); |
1113 | 1113 |
1114 Child child_info; | 1114 Child child_info; |
1115 child_info.return_callback = return_callback; | 1115 child_info.return_callback = return_callback; |
1116 | 1116 |
1117 int child = next_child_++; | 1117 int child = next_child_++; |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 ContextProvider* context_provider = output_surface_->context_provider(); | 2073 ContextProvider* context_provider = output_surface_->context_provider(); |
2074 return context_provider ? context_provider->ContextGL() : NULL; | 2074 return context_provider ? context_provider->ContextGL() : NULL; |
2075 } | 2075 } |
2076 | 2076 |
2077 class GrContext* ResourceProvider::GrContext() const { | 2077 class GrContext* ResourceProvider::GrContext() const { |
2078 ContextProvider* context_provider = output_surface_->context_provider(); | 2078 ContextProvider* context_provider = output_surface_->context_provider(); |
2079 return context_provider ? context_provider->GrContext() : NULL; | 2079 return context_provider ? context_provider->GrContext() : NULL; |
2080 } | 2080 } |
2081 | 2081 |
2082 } // namespace cc | 2082 } // namespace cc |
OLD | NEW |