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

Side by Side Diff: gpu/command_buffer/service/texture_manager.h

Issue 16293004: Update gpu/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 GLsizei width, GLsizei height, GLsizei depth); 494 GLsizei width, GLsizei height, GLsizei depth);
495 495
496 // Checks if a dimensions are valid for a given target. 496 // Checks if a dimensions are valid for a given target.
497 bool ValidForTarget( 497 bool ValidForTarget(
498 GLenum target, GLint level, 498 GLenum target, GLint level,
499 GLsizei width, GLsizei height, GLsizei depth); 499 GLsizei width, GLsizei height, GLsizei depth);
500 500
501 // True if this texture meets all the GLES2 criteria for rendering. 501 // True if this texture meets all the GLES2 criteria for rendering.
502 // See section 3.8.2 of the GLES2 spec. 502 // See section 3.8.2 of the GLES2 spec.
503 bool CanRender(const TextureRef* ref) const { 503 bool CanRender(const TextureRef* ref) const {
504 return ref->texture()->CanRender(feature_info_); 504 return ref->texture()->CanRender(feature_info_.get());
505 } 505 }
506 506
507 // Returns true if mipmaps can be generated by GL. 507 // Returns true if mipmaps can be generated by GL.
508 bool CanGenerateMipmaps(const TextureRef* ref) const { 508 bool CanGenerateMipmaps(const TextureRef* ref) const {
509 return ref->texture()->CanGenerateMipmaps(feature_info_); 509 return ref->texture()->CanGenerateMipmaps(feature_info_.get());
510 } 510 }
511 511
512 // Sets the Texture's target 512 // Sets the Texture's target
513 // Parameters: 513 // Parameters:
514 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP 514 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP
515 // max_levels: The maximum levels this type of target can have. 515 // max_levels: The maximum levels this type of target can have.
516 void SetTarget( 516 void SetTarget(
517 TextureRef* ref, 517 TextureRef* ref,
518 GLenum target); 518 GLenum target);
519 519
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 // Removes a texture info. 580 // Removes a texture info.
581 void RemoveTexture(GLuint client_id); 581 void RemoveTexture(GLuint client_id);
582 582
583 // Gets a Texture for a given service id (note: it assumes the texture object 583 // Gets a Texture for a given service id (note: it assumes the texture object
584 // is still mapped in this TextureManager). 584 // is still mapped in this TextureManager).
585 Texture* GetTextureForServiceId(GLuint service_id) const; 585 Texture* GetTextureForServiceId(GLuint service_id) const;
586 586
587 TextureRef* GetDefaultTextureInfo(GLenum target) { 587 TextureRef* GetDefaultTextureInfo(GLenum target) {
588 switch (target) { 588 switch (target) {
589 case GL_TEXTURE_2D: 589 case GL_TEXTURE_2D:
590 return default_textures_[kTexture2D]; 590 return default_textures_[kTexture2D].get();
591 case GL_TEXTURE_CUBE_MAP: 591 case GL_TEXTURE_CUBE_MAP:
592 return default_textures_[kCubeMap]; 592 return default_textures_[kCubeMap].get();
593 case GL_TEXTURE_EXTERNAL_OES: 593 case GL_TEXTURE_EXTERNAL_OES:
594 return default_textures_[kExternalOES]; 594 return default_textures_[kExternalOES].get();
595 case GL_TEXTURE_RECTANGLE_ARB: 595 case GL_TEXTURE_RECTANGLE_ARB:
596 return default_textures_[kRectangleARB]; 596 return default_textures_[kRectangleARB].get();
597 default: 597 default:
598 NOTREACHED(); 598 NOTREACHED();
599 return NULL; 599 return NULL;
600 } 600 }
601 } 601 }
602 602
603 bool HaveUnrenderableTextures() const { 603 bool HaveUnrenderableTextures() const {
604 return num_unrenderable_textures_ > 0; 604 return num_unrenderable_textures_ > 0;
605 } 605 }
606 606
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 709
710 ObserverList<DestructionObserver> destruction_observers_; 710 ObserverList<DestructionObserver> destruction_observers_;
711 711
712 DISALLOW_COPY_AND_ASSIGN(TextureManager); 712 DISALLOW_COPY_AND_ASSIGN(TextureManager);
713 }; 713 };
714 714
715 } // namespace gles2 715 } // namespace gles2
716 } // namespace gpu 716 } // namespace gpu
717 717
718 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 718 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/shader_manager_unittest.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698