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 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2127 | 2127 |
2128 resource->read_lock_fence->Wait(); | 2128 resource->read_lock_fence->Wait(); |
2129 } | 2129 } |
2130 | 2130 |
2131 GLint ResourceProvider::GetActiveTextureUnit(GLES2Interface* gl) { | 2131 GLint ResourceProvider::GetActiveTextureUnit(GLES2Interface* gl) { |
2132 GLint active_unit = 0; | 2132 GLint active_unit = 0; |
2133 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); | 2133 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); |
2134 return active_unit; | 2134 return active_unit; |
2135 } | 2135 } |
2136 | 2136 |
2137 void ResourceProvider::ValidateResource(ResourceId id) { | |
2138 DCHECK(thread_checker_.CalledOnValidThread()); | |
2139 CHECK(id); | |
2140 ResourceMap::iterator it = resources_.find(id); | |
2141 CHECK(it != resources_.end()); | |
piman
2015/04/07 00:13:39
nit: all that is essentially (void)GetResource(id)
danakj
2015/04/07 00:15:00
Ya I copied it from there. Heh. My random thought
| |
2142 } | |
2143 | |
2137 GLES2Interface* ResourceProvider::ContextGL() const { | 2144 GLES2Interface* ResourceProvider::ContextGL() const { |
2138 ContextProvider* context_provider = output_surface_->context_provider(); | 2145 ContextProvider* context_provider = output_surface_->context_provider(); |
2139 return context_provider ? context_provider->ContextGL() : NULL; | 2146 return context_provider ? context_provider->ContextGL() : NULL; |
2140 } | 2147 } |
2141 | 2148 |
2142 class GrContext* ResourceProvider::GrContext(bool worker_context) const { | 2149 class GrContext* ResourceProvider::GrContext(bool worker_context) const { |
2143 ContextProvider* context_provider = | 2150 ContextProvider* context_provider = |
2144 worker_context ? output_surface_->worker_context_provider() | 2151 worker_context ? output_surface_->worker_context_provider() |
2145 : output_surface_->context_provider(); | 2152 : output_surface_->context_provider(); |
2146 return context_provider ? context_provider->GrContext() : NULL; | 2153 return context_provider ? context_provider->GrContext() : NULL; |
2147 } | 2154 } |
2148 | 2155 |
2149 } // namespace cc | 2156 } // namespace cc |
OLD | NEW |