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

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

Issue 1062043003: cc: Add ResourceId validation checks at the time of AppendQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resource-validate: fixtests Created 5 years, 8 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/layers/video_layer_impl.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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 void CopyResource(ResourceId source_id, ResourceId dest_id); 428 void CopyResource(ResourceId source_id, ResourceId dest_id);
429 429
430 void WaitSyncPointIfNeeded(ResourceId id); 430 void WaitSyncPointIfNeeded(ResourceId id);
431 431
432 void WaitReadLockIfNeeded(ResourceId id); 432 void WaitReadLockIfNeeded(ResourceId id);
433 433
434 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); 434 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl);
435 435
436 OutputSurface* output_surface() { return output_surface_; } 436 OutputSurface* output_surface() { return output_surface_; }
437 437
438 void ValidateResource(ResourceId id);
439
438 private: 440 private:
439 struct Resource { 441 struct Resource {
440 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; 442 enum Origin { INTERNAL, EXTERNAL, DELEGATED };
441 443
442 Resource(); 444 Resource();
443 ~Resource(); 445 ~Resource();
444 Resource(unsigned texture_id, 446 Resource(unsigned texture_id,
445 const gfx::Size& size, 447 const gfx::Size& size,
446 Origin origin, 448 Origin origin,
447 GLenum target, 449 GLenum target,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 return format_gl_data_format[format]; 661 return format_gl_data_format[format];
660 } 662 }
661 663
662 inline GLenum GLInternalFormat(ResourceFormat format) { 664 inline GLenum GLInternalFormat(ResourceFormat format) {
663 return GLDataFormat(format); 665 return GLDataFormat(format);
664 } 666 }
665 667
666 } // namespace cc 668 } // namespace cc
667 669
668 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 670 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698