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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 DCHECK_EQ(resource->exported_count, 0); | 959 DCHECK_EQ(resource->exported_count, 0); |
960 DCHECK(resource->origin == Resource::INTERNAL); | 960 DCHECK(resource->origin == Resource::INTERNAL); |
961 resource->locked_for_write = false; | 961 resource->locked_for_write = false; |
962 } | 962 } |
963 | 963 |
964 ResourceProvider::ScopedReadLockGL::ScopedReadLockGL( | 964 ResourceProvider::ScopedReadLockGL::ScopedReadLockGL( |
965 ResourceProvider* resource_provider, | 965 ResourceProvider* resource_provider, |
966 ResourceProvider::ResourceId resource_id) | 966 ResourceProvider::ResourceId resource_id) |
967 : resource_provider_(resource_provider), | 967 : resource_provider_(resource_provider), |
968 resource_id_(resource_id), | 968 resource_id_(resource_id), |
969 texture_id_(resource_provider->LockForRead(resource_id)->gl_id) { | 969 resource_(resource_provider->LockForRead(resource_id)) { |
970 DCHECK(texture_id_); | 970 DCHECK(resource_); |
971 } | 971 } |
972 | 972 |
973 ResourceProvider::ScopedReadLockGL::~ScopedReadLockGL() { | 973 ResourceProvider::ScopedReadLockGL::~ScopedReadLockGL() { |
974 resource_provider_->UnlockForRead(resource_id_); | 974 resource_provider_->UnlockForRead(resource_id_); |
975 } | 975 } |
976 | 976 |
977 ResourceProvider::ScopedSamplerGL::ScopedSamplerGL( | 977 ResourceProvider::ScopedSamplerGL::ScopedSamplerGL( |
978 ResourceProvider* resource_provider, | 978 ResourceProvider* resource_provider, |
979 ResourceProvider::ResourceId resource_id, | 979 ResourceProvider::ResourceId resource_id, |
980 GLenum filter) | 980 GLenum filter) |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 } | 2056 } |
2057 | 2057 |
2058 class GrContext* ResourceProvider::GrContext(bool worker_context) const { | 2058 class GrContext* ResourceProvider::GrContext(bool worker_context) const { |
2059 ContextProvider* context_provider = | 2059 ContextProvider* context_provider = |
2060 worker_context ? output_surface_->worker_context_provider() | 2060 worker_context ? output_surface_->worker_context_provider() |
2061 : output_surface_->context_provider(); | 2061 : output_surface_->context_provider(); |
2062 return context_provider ? context_provider->GrContext() : NULL; | 2062 return context_provider ? context_provider->GrContext() : NULL; |
2063 } | 2063 } |
2064 | 2064 |
2065 } // namespace cc | 2065 } // namespace cc |
OLD | NEW |