Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / cc / resources / scoped_resource.cc
index 99f93c9..407de51 100644 (file)
@@ -15,8 +15,8 @@ ScopedResource::~ScopedResource() {
   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());
@@ -25,12 +25,12 @@ void ScopedResource::Allocate(gfx::Size size,
   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());
@@ -41,17 +41,17 @@ void ScopedResource::AllocateManaged(gfx::Size size,
       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());