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

Unified Diff: cc/resources/scoped_resource.h

Issue 1531403002: Revert "Delete CC." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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/resources/returned_resource.h ('k') | cc/resources/scoped_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/scoped_resource.h
diff --git a/cc/resources/scoped_resource.h b/cc/resources/scoped_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ea56ed71d6eccefb2e1df5968c7737fd0c086c1
--- /dev/null
+++ b/cc/resources/scoped_resource.h
@@ -0,0 +1,50 @@
+// 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.
+
+#ifndef CC_RESOURCES_SCOPED_RESOURCE_H_
+#define CC_RESOURCES_SCOPED_RESOURCE_H_
+
+#include "base/basictypes.h"
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "cc/resources/resource.h"
+
+#if DCHECK_IS_ON()
+#include "base/threading/platform_thread.h"
+#endif
+
+namespace cc {
+
+class ScopedResource : public Resource {
+ public:
+ static scoped_ptr<ScopedResource> Create(
+ ResourceProvider* resource_provider) {
+ return make_scoped_ptr(new ScopedResource(resource_provider));
+ }
+ virtual ~ScopedResource();
+
+ void Allocate(const gfx::Size& size,
+ ResourceProvider::TextureHint hint,
+ ResourceFormat format);
+ void AllocateManaged(const gfx::Size& size,
+ GLenum target,
+ ResourceFormat format);
+ void Free();
+
+ protected:
+ explicit ScopedResource(ResourceProvider* provider);
+
+ private:
+ ResourceProvider* resource_provider_;
+
+#if DCHECK_IS_ON()
+ base::PlatformThreadId allocate_thread_id_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedResource);
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_SCOPED_RESOURCE_H_
« no previous file with comments | « cc/resources/returned_resource.h ('k') | cc/resources/scoped_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698