Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: cc/scoped_resource.cc

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scoped_resource.h ('k') | cc/scoped_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scoped_resource.cc
diff --git a/cc/scoped_resource.cc b/cc/scoped_resource.cc
deleted file mode 100644
index 709c73d7720b79d50aea873d6107fbe2d7415dfd..0000000000000000000000000000000000000000
--- a/cc/scoped_resource.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/scoped_resource.h"
-
-namespace cc {
-
-ScopedResource::ScopedResource(ResourceProvider* resource_provider)
- : resource_provider_(resource_provider) {
- DCHECK(resource_provider_);
-}
-
-ScopedResource::~ScopedResource() {
- Free();
-}
-
-bool ScopedResource::Allocate(const gfx::Size& size, GLenum format,
- ResourceProvider::TextureUsageHint hint) {
- DCHECK(!id());
- DCHECK(!size.IsEmpty());
-
- set_dimensions(size, format);
- set_id(resource_provider_->CreateResource(size, format, hint));
-
-#ifndef NDEBUG
- allocate_thread_id_ = base::PlatformThread::CurrentId();
-#endif
-
- return id();
-}
-
-void ScopedResource::Free() {
- if (id()) {
-#ifndef NDEBUG
- DCHECK(allocate_thread_id_ == base::PlatformThread::CurrentId());
-#endif
- resource_provider_->DeleteResource(id());
- }
- set_id(0);
-}
-
-void ScopedResource::Leak() {
- set_id(0);
-}
-
-} // namespace cc
« no previous file with comments | « cc/scoped_resource.h ('k') | cc/scoped_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698