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

Side by Side Diff: cc/scoped_resource.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/transferable_resource.cc ('k') | cc/scoped_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_SCOPED_RESOURCE_H_
6 #define CC_SCOPED_RESOURCE_H_
7
8 #include "base/basictypes.h"
9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "cc/base/cc_export.h"
12 #include "cc/resource.h"
13
14 #ifndef NDEBUG
15 #include "base/threading/platform_thread.h"
16 #endif
17
18 namespace cc {
19
20 class CC_EXPORT ScopedResource : public Resource {
21 public:
22 static scoped_ptr<ScopedResource> create(
23 ResourceProvider* resource_provider) {
24 return make_scoped_ptr(new ScopedResource(resource_provider));
25 }
26 virtual ~ScopedResource();
27
28 bool Allocate(const gfx::Size&, GLenum format,
29 ResourceProvider::TextureUsageHint);
30 void Free();
31 void Leak();
32
33 protected:
34 explicit ScopedResource(ResourceProvider*);
35
36 private:
37 ResourceProvider* resource_provider_;
38
39 #ifndef NDEBUG
40 base::PlatformThreadId allocate_thread_id_;
41 #endif
42
43 DISALLOW_COPY_AND_ASSIGN(ScopedResource);
44 };
45
46 }
47
48 #endif // CC_SCOPED_RESOURCE_H_
OLDNEW
« no previous file with comments | « cc/resources/transferable_resource.cc ('k') | cc/scoped_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698