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

Side by Side Diff: cc/resources/scoped_resource.h

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc Created 7 years, 3 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
« no previous file with comments | « cc/resources/resource_update_controller_unittest.cc ('k') | cc/resources/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
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_RESOURCES_SCOPED_RESOURCE_H_ 5 #ifndef CC_RESOURCES_SCOPED_RESOURCE_H_
6 #define CC_RESOURCES_SCOPED_RESOURCE_H_ 6 #define CC_RESOURCES_SCOPED_RESOURCE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "cc/resources/resource.h" 12 #include "cc/resources/resource.h"
13 13
14 #ifndef NDEBUG 14 #ifndef NDEBUG
15 #include "base/threading/platform_thread.h" 15 #include "base/threading/platform_thread.h"
16 #endif 16 #endif
17 17
18 namespace cc { 18 namespace cc {
19 19
20 class CC_EXPORT ScopedResource : public Resource { 20 class CC_EXPORT ScopedResource : public Resource {
21 public: 21 public:
22 static scoped_ptr<ScopedResource> create( 22 static scoped_ptr<ScopedResource> create(
23 ResourceProvider* resource_provider) { 23 ResourceProvider* resource_provider) {
24 return make_scoped_ptr(new ScopedResource(resource_provider)); 24 return make_scoped_ptr(new ScopedResource(resource_provider));
25 } 25 }
26 virtual ~ScopedResource(); 26 virtual ~ScopedResource();
27 27
28 bool Allocate(gfx::Size size, 28 bool Allocate(gfx::Size size,
29 GLenum format, 29 ResourceProvider::TextureUsageHint hint,
30 ResourceProvider::TextureUsageHint hint); 30 ResourceFormat texture_format);
31 void Free(); 31 void Free();
32 void Leak(); 32 void Leak();
33 33
34 protected: 34 protected:
35 explicit ScopedResource(ResourceProvider* provider); 35 explicit ScopedResource(ResourceProvider* provider);
36 36
37 private: 37 private:
38 ResourceProvider* resource_provider_; 38 ResourceProvider* resource_provider_;
39 39
40 #ifndef NDEBUG 40 #ifndef NDEBUG
41 base::PlatformThreadId allocate_thread_id_; 41 base::PlatformThreadId allocate_thread_id_;
42 #endif 42 #endif
43 43
44 DISALLOW_COPY_AND_ASSIGN(ScopedResource); 44 DISALLOW_COPY_AND_ASSIGN(ScopedResource);
45 }; 45 };
46 46
47 } // namespace cc 47 } // namespace cc
48 48
49 #endif // CC_RESOURCES_SCOPED_RESOURCE_H_ 49 #endif // CC_RESOURCES_SCOPED_RESOURCE_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_update_controller_unittest.cc ('k') | cc/resources/scoped_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698