| OLD | NEW |
| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "gpu/command_buffer/service/gl_utils.h" | 15 #include "gpu/command_buffer/service/gl_utils.h" |
| 16 #include "gpu/command_buffer/service/memory_tracking.h" | 16 #include "gpu/command_buffer/service/memory_tracking.h" |
| 17 #include "gpu/gpu_export.h" | 17 #include "gpu/gpu_export.h" |
| 18 #include "ui/gl/async_pixel_transfer_delegate.h" | 18 #include "ui/gl/async_pixel_transfer_delegate.h" |
| 19 #include "ui/gl/gl_image.h" | 19 #include "ui/gl/gl_image.h" |
| 20 | 20 |
| 21 namespace gpu { | 21 namespace gpu { |
| 22 namespace gles2 { | 22 namespace gles2 { |
| 23 | 23 |
| 24 class GLES2Decoder; | 24 class GLES2Decoder; |
| 25 class Display; | 25 class Display; |
| 26 class ErrorState; |
| 26 class FeatureInfo; | 27 class FeatureInfo; |
| 27 class TextureDefinition; | 28 class TextureDefinition; |
| 28 class TextureManager; | 29 class TextureManager; |
| 29 | 30 |
| 30 // Info about Textures currently in the system. | 31 // Info about Textures currently in the system. |
| 31 class GPU_EXPORT Texture : public base::RefCounted<Texture> { | 32 class GPU_EXPORT Texture : public base::RefCounted<Texture> { |
| 32 public: | 33 public: |
| 33 Texture(TextureManager* manager, GLuint service_id); | 34 Texture(TextureManager* manager, GLuint service_id); |
| 34 | 35 |
| 35 GLenum min_filter() const { | 36 GLenum min_filter() const { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 TextureDefinition* definition); | 471 TextureDefinition* definition); |
| 471 | 472 |
| 472 // Sets a mip as cleared. | 473 // Sets a mip as cleared. |
| 473 void SetLevelCleared(Texture* texture, GLenum target, | 474 void SetLevelCleared(Texture* texture, GLenum target, |
| 474 GLint level, bool cleared); | 475 GLint level, bool cleared); |
| 475 | 476 |
| 476 // Sets a texture parameter of a Texture | 477 // Sets a texture parameter of a Texture |
| 477 // Returns GL_NO_ERROR on success. Otherwise the error to generate. | 478 // Returns GL_NO_ERROR on success. Otherwise the error to generate. |
| 478 // TODO(gman): Expand to SetParameteri,f,iv,fv | 479 // TODO(gman): Expand to SetParameteri,f,iv,fv |
| 479 void SetParameter( | 480 void SetParameter( |
| 480 const char* function_name, GLES2Decoder* decoder, | 481 const char* function_name, ErrorState* error_state, |
| 481 Texture* texture, GLenum pname, GLint param); | 482 Texture* texture, GLenum pname, GLint param); |
| 482 | 483 |
| 483 // Makes each of the mip levels as though they were generated. | 484 // Makes each of the mip levels as though they were generated. |
| 484 // Returns false if that's not allowed for the given texture. | 485 // Returns false if that's not allowed for the given texture. |
| 485 bool MarkMipmapsGenerated(Texture* texture); | 486 bool MarkMipmapsGenerated(Texture* texture); |
| 486 | 487 |
| 487 // Clears any uncleared renderable levels. | 488 // Clears any uncleared renderable levels. |
| 488 bool ClearRenderableLevels(GLES2Decoder* decoder, Texture* texture); | 489 bool ClearRenderableLevels(GLES2Decoder* decoder, Texture* texture); |
| 489 | 490 |
| 490 // Clear a specific level. | 491 // Clear a specific level. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 // The default textures for each target (texture name = 0) | 610 // The default textures for each target (texture name = 0) |
| 610 scoped_refptr<Texture> default_textures_[kNumDefaultTextures]; | 611 scoped_refptr<Texture> default_textures_[kNumDefaultTextures]; |
| 611 | 612 |
| 612 DISALLOW_COPY_AND_ASSIGN(TextureManager); | 613 DISALLOW_COPY_AND_ASSIGN(TextureManager); |
| 613 }; | 614 }; |
| 614 | 615 |
| 615 } // namespace gles2 | 616 } // namespace gles2 |
| 616 } // namespace gpu | 617 } // namespace gpu |
| 617 | 618 |
| 618 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 619 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| OLD | NEW |