Free();
}
-void ScopedResource::Allocate(gfx::Size size,
- ResourceProvider::TextureUsageHint hint,
+void ScopedResource::Allocate(const gfx::Size& size,
+ ResourceProvider::TextureHint hint,
ResourceFormat format) {
DCHECK(!id());
DCHECK(!size.IsEmpty());
set_id(resource_provider_->CreateResource(
size, GL_CLAMP_TO_EDGE, hint, format));
-#ifndef NDEBUG
+#if DCHECK_IS_ON
allocate_thread_id_ = base::PlatformThread::CurrentId();
#endif
}
-void ScopedResource::AllocateManaged(gfx::Size size,
+void ScopedResource::AllocateManaged(const gfx::Size& size,
GLenum target,
ResourceFormat format) {
DCHECK(!id());
size,
target,
GL_CLAMP_TO_EDGE,
- ResourceProvider::TextureUsageAny,
+ ResourceProvider::TextureHintImmutable,
format));
-#ifndef NDEBUG
+#if DCHECK_IS_ON
allocate_thread_id_ = base::PlatformThread::CurrentId();
#endif
}
void ScopedResource::Free() {
if (id()) {
-#ifndef NDEBUG
+#if DCHECK_IS_ON
DCHECK(allocate_thread_id_ == base::PlatformThread::CurrentId());
#endif
resource_provider_->DeleteResource(id());