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

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

Issue 1124203006: cc: Render TextureLayer which texture target is not GL_TEXTURE_2D correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix unittests Created 5 years, 7 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/output/gl_renderer_unittest.cc ('k') | cc/resources/resource_provider.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_RESOURCE_PROVIDER_H_ 5 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_
6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // The following lock classes are part of the ResourceProvider API and are 216 // The following lock classes are part of the ResourceProvider API and are
217 // needed to read and write the resource contents. The user must ensure 217 // needed to read and write the resource contents. The user must ensure
218 // that they only use GL locks on GL resources, etc, and this is enforced 218 // that they only use GL locks on GL resources, etc, and this is enforced
219 // by assertions. 219 // by assertions.
220 class CC_EXPORT ScopedReadLockGL { 220 class CC_EXPORT ScopedReadLockGL {
221 public: 221 public:
222 ScopedReadLockGL(ResourceProvider* resource_provider, 222 ScopedReadLockGL(ResourceProvider* resource_provider,
223 ResourceProvider::ResourceId resource_id); 223 ResourceProvider::ResourceId resource_id);
224 virtual ~ScopedReadLockGL(); 224 virtual ~ScopedReadLockGL();
225 225
226 unsigned texture_id() const { return texture_id_; } 226 unsigned texture_id() const { return resource_->gl_id; }
227 GLenum target() const { return resource_->target; }
227 228
228 protected: 229 protected:
229 ResourceProvider* resource_provider_; 230 ResourceProvider* resource_provider_;
230 ResourceProvider::ResourceId resource_id_; 231 ResourceProvider::ResourceId resource_id_;
231 232
232 private: 233 private:
233 unsigned texture_id_; 234 const ResourceProvider::Resource* resource_;
234 235
235 DISALLOW_COPY_AND_ASSIGN(ScopedReadLockGL); 236 DISALLOW_COPY_AND_ASSIGN(ScopedReadLockGL);
236 }; 237 };
237 238
238 class CC_EXPORT ScopedSamplerGL : public ScopedReadLockGL { 239 class CC_EXPORT ScopedSamplerGL : public ScopedReadLockGL {
239 public: 240 public:
240 ScopedSamplerGL(ResourceProvider* resource_provider, 241 ScopedSamplerGL(ResourceProvider* resource_provider,
241 ResourceProvider::ResourceId resource_id, 242 ResourceProvider::ResourceId resource_id,
242 GLenum filter); 243 GLenum filter);
243 ScopedSamplerGL(ResourceProvider* resource_provider, 244 ScopedSamplerGL(ResourceProvider* resource_provider,
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 return format_gl_data_format[format]; 659 return format_gl_data_format[format];
659 } 660 }
660 661
661 inline GLenum GLInternalFormat(ResourceFormat format) { 662 inline GLenum GLInternalFormat(ResourceFormat format) {
662 return GLDataFormat(format); 663 return GLDataFormat(format);
663 } 664 }
664 665
665 } // namespace cc 666 } // namespace cc
666 667
667 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 668 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/output/gl_renderer_unittest.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698