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

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

Issue 2235623003: cc: Add gfx::ColorSpace to cc::ResourceProvider resource creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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_provider_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 <memory> 8 #include <memory>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
22 class CC_EXPORT ScopedResource : public Resource { 22 class CC_EXPORT ScopedResource : public Resource {
23 public: 23 public:
24 static std::unique_ptr<ScopedResource> Create( 24 static std::unique_ptr<ScopedResource> Create(
25 ResourceProvider* resource_provider) { 25 ResourceProvider* resource_provider) {
26 return base::WrapUnique(new ScopedResource(resource_provider)); 26 return base::WrapUnique(new ScopedResource(resource_provider));
27 } 27 }
28 virtual ~ScopedResource(); 28 virtual ~ScopedResource();
29 29
30 void Allocate(const gfx::Size& size, 30 void Allocate(const gfx::Size& size,
31 ResourceProvider::TextureHint hint, 31 ResourceProvider::TextureHint hint,
32 ResourceFormat format); 32 ResourceFormat format,
33 const gfx::ColorSpace& color_space);
33 void AllocateWithGpuMemoryBuffer(const gfx::Size& size, 34 void AllocateWithGpuMemoryBuffer(const gfx::Size& size,
34 ResourceFormat format, 35 ResourceFormat format,
35 gfx::BufferUsage usage); 36 gfx::BufferUsage usage,
37 const gfx::ColorSpace& color_space);
36 void Free(); 38 void Free();
37 39
38 protected: 40 protected:
39 explicit ScopedResource(ResourceProvider* provider); 41 explicit ScopedResource(ResourceProvider* provider);
40 42
41 private: 43 private:
42 ResourceProvider* resource_provider_; 44 ResourceProvider* resource_provider_;
43 45
44 #if DCHECK_IS_ON() 46 #if DCHECK_IS_ON()
45 base::PlatformThreadId allocate_thread_id_; 47 base::PlatformThreadId allocate_thread_id_;
46 #endif 48 #endif
47 49
48 DISALLOW_COPY_AND_ASSIGN(ScopedResource); 50 DISALLOW_COPY_AND_ASSIGN(ScopedResource);
49 }; 51 };
50 52
51 } // namespace cc 53 } // namespace cc
52 54
53 #endif // CC_RESOURCES_SCOPED_RESOURCE_H_ 55 #endif // CC_RESOURCES_SCOPED_RESOURCE_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_provider_unittest.cc ('k') | cc/resources/scoped_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698