| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Get the type of a level. Returns false if level does not exist. | 174 // Get the type of a level. Returns false if level does not exist. |
| 175 bool GetLevelType( | 175 bool GetLevelType( |
| 176 GLint target, GLint level, GLenum* type, GLenum* internal_format) const; | 176 GLint target, GLint level, GLenum* type, GLenum* internal_format) const; |
| 177 | 177 |
| 178 // Set the image for a particular level. If a GLStreamTextureImage was | 178 // Set the image for a particular level. If a GLStreamTextureImage was |
| 179 // previously set with SetLevelStreamTextureImage(), this will reset | 179 // previously set with SetLevelStreamTextureImage(), this will reset |
| 180 // |service_id_| back to |owned_service_id_|, removing the service id override | 180 // |service_id_| back to |owned_service_id_|, removing the service id override |
| 181 // set by the GLStreamTextureImage. | 181 // set by the GLStreamTextureImage. |
| 182 void SetLevelImage(GLenum target, | 182 void SetLevelImage(GLenum target, |
| 183 GLint level, | 183 GLint level, |
| 184 GLint layer, |
| 184 gl::GLImage* image, | 185 gl::GLImage* image, |
| 185 ImageState state); | 186 ImageState state); |
| 186 | 187 |
| 187 // Set the GLStreamTextureImage for a particular level. This is like | 188 // Set the GLStreamTextureImage for a particular level. This is like |
| 188 // SetLevelImage, but it also makes it optional to override |service_id_| with | 189 // SetLevelImage, but it also makes it optional to override |service_id_| with |
| 189 // a texture bound to the stream texture, and permits | 190 // a texture bound to the stream texture, and permits |
| 190 // GetLevelStreamTextureImage to return the image. See | 191 // GetLevelStreamTextureImage to return the image. See |
| 191 // SetStreamTextureServiceId() for the details of how |service_id| is used. | 192 // SetStreamTextureServiceId() for the details of how |service_id| is used. |
| 192 void SetLevelStreamTextureImage(GLenum target, | 193 void SetLevelStreamTextureImage(GLenum target, |
| 193 GLint level, | 194 GLint level, |
| 195 GLint layer, |
| 194 GLStreamTextureImage* image, | 196 GLStreamTextureImage* image, |
| 195 ImageState state, | 197 ImageState state, |
| 196 GLuint service_id); | 198 GLuint service_id); |
| 197 | 199 |
| 198 // Set the ImageState for the image bound to the given level. | 200 // Set the ImageState for the image bound to the given level. |
| 199 void SetLevelImageState(GLenum target, GLint level, ImageState state); | 201 void SetLevelImageState(GLenum target, |
| 202 GLint level, |
| 203 GLint layer, |
| 204 ImageState state); |
| 200 | 205 |
| 201 | 206 |
| 202 // Get the image associated with a particular level. Returns NULL if level | 207 // Get the image associated with a particular level. Returns NULL if level |
| 203 // does not exist. | 208 // does not exist. |
| 204 gl::GLImage* GetLevelImage(GLint target, | 209 gl::GLImage* GetLevelImage(GLint target, |
| 205 GLint level, | 210 GLint level, |
| 211 GLint layer, |
| 206 ImageState* state) const; | 212 ImageState* state) const; |
| 207 gl::GLImage* GetLevelImage(GLint target, GLint level) const; | 213 gl::GLImage* GetLevelImage(GLint target, GLint level, GLint layer) const; |
| 208 | 214 |
| 209 // Like GetLevelImage, but will return NULL if the image wasn't set via | 215 // Like GetLevelImage, but will return NULL if the image wasn't set via |
| 210 // a call to SetLevelStreamTextureImage. | 216 // a call to SetLevelStreamTextureImage. |
| 211 GLStreamTextureImage* GetLevelStreamTextureImage(GLint target, | 217 GLStreamTextureImage* GetLevelStreamTextureImage(GLint target, |
| 212 GLint level) const; | 218 GLint level, |
| 219 GLint layer) const; |
| 213 | 220 |
| 214 bool HasImages() const { | 221 bool HasImages() const { |
| 215 return has_images_; | 222 return has_images_; |
| 216 } | 223 } |
| 217 | 224 |
| 218 // Returns true of the given dimensions are inside the dimensions of the | 225 // Returns true of the given dimensions are inside the dimensions of the |
| 219 // level. | 226 // level. |
| 220 bool ValidForTexture( | 227 bool ValidForTexture( |
| 221 GLint target, | 228 GLint target, |
| 222 GLint level, | 229 GLint level, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 250 | 257 |
| 251 bool IsImmutable() const { | 258 bool IsImmutable() const { |
| 252 return immutable_; | 259 return immutable_; |
| 253 } | 260 } |
| 254 | 261 |
| 255 // Return 0 if it's not immutable. | 262 // Return 0 if it's not immutable. |
| 256 GLint GetImmutableLevels() const; | 263 GLint GetImmutableLevels() const; |
| 257 | 264 |
| 258 // Get the cleared rectangle for a particular level. Returns an empty | 265 // Get the cleared rectangle for a particular level. Returns an empty |
| 259 // rectangle if level does not exist. | 266 // rectangle if level does not exist. |
| 260 gfx::Rect GetLevelClearedRect(GLenum target, GLint level) const; | 267 gfx::Rect GetLevelClearedRect(GLenum target, GLint level, GLint layer) const; |
| 268 // TODO(yunchao) Wrap the original GetLevelClearedRect on the basis of |
| 269 // GetLayerClearedRect. The origianl GetLevelClearedRect for 2D texture |
| 270 // Will be not aware of parameter layer. |
| 271 // Do the same for SetLevelClearedRect, isLevelCleared, etc. |
| 272 // gfx::Rect GetLevelClearedRect(GLenum target, GLint level) const { |
| 273 // GetLayerClearedRect(target, level, 0); |
| 274 // } |
| 275 // |
| 276 // gfx::Rect GetLayerClearedRect(GLenum target, |
| 277 // GLint level, |
| 278 // GLint layer) const; |
| 261 | 279 |
| 262 // Whether a particular level/face is cleared. | 280 // Whether a particular level/face is cleared. |
| 263 bool IsLevelCleared(GLenum target, GLint level) const; | 281 bool IsLevelCleared(GLenum target, GLint level, GLint layer) const; |
| 264 // Whether a particular level/face is partially cleared. | 282 // Whether a particular level/face is partially cleared. |
| 265 bool IsLevelPartiallyCleared(GLenum target, GLint level) const; | 283 bool IsLevelPartiallyCleared(GLenum target, |
| 284 GLint level, |
| 285 GLint layer) const; |
| 266 | 286 |
| 267 // Whether the texture has been defined | 287 // Whether the texture has been defined |
| 268 bool IsDefined() const { | 288 bool IsDefined() const { |
| 269 return estimated_size() > 0; | 289 return estimated_size() > 0; |
| 270 } | 290 } |
| 271 | 291 |
| 272 // Initialize TEXTURE_MAX_ANISOTROPY to 1 if we haven't done so yet. | 292 // Initialize TEXTURE_MAX_ANISOTROPY to 1 if we haven't done so yet. |
| 273 void InitTextureMaxAnisotropyIfNeeded(GLenum target); | 293 void InitTextureMaxAnisotropyIfNeeded(GLenum target); |
| 274 | 294 |
| 275 void DumpLevelMemory(base::trace_event::ProcessMemoryDump* pmd, | 295 void DumpLevelMemory(base::trace_event::ProcessMemoryDump* pmd, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 299 // renderable if NPOT support is in the context, otherwise not, e.g. texture | 319 // renderable if NPOT support is in the context, otherwise not, e.g. texture |
| 300 // with a NPOT level). ALWAYS means it doesn't depend on context features | 320 // with a NPOT level). ALWAYS means it doesn't depend on context features |
| 301 // (e.g. complete POT), NEVER means it's not renderable regardless (e.g. | 321 // (e.g. complete POT), NEVER means it's not renderable regardless (e.g. |
| 302 // incomplete). | 322 // incomplete). |
| 303 enum CanRenderCondition { | 323 enum CanRenderCondition { |
| 304 CAN_RENDER_ALWAYS, | 324 CAN_RENDER_ALWAYS, |
| 305 CAN_RENDER_NEVER, | 325 CAN_RENDER_NEVER, |
| 306 CAN_RENDER_NEEDS_VALIDATION, | 326 CAN_RENDER_NEEDS_VALIDATION, |
| 307 }; | 327 }; |
| 308 | 328 |
| 329 struct LayerInfo { |
| 330 LayerInfo(); |
| 331 LayerInfo(const LayerInfo& rhs); |
| 332 ~LayerInfo(); |
| 333 |
| 334 gfx::Rect cleared_rect; |
| 335 scoped_refptr<gl::GLImage> image; |
| 336 scoped_refptr<GLStreamTextureImage> stream_texture_image; |
| 337 ImageState image_state; |
| 338 // This variable may be not useful; |
| 339 GLint layer; |
| 340 }; |
| 341 |
| 309 struct LevelInfo { | 342 struct LevelInfo { |
| 310 LevelInfo(); | 343 LevelInfo(); |
| 311 LevelInfo(const LevelInfo& rhs); | 344 LevelInfo(const LevelInfo& rhs); |
| 312 ~LevelInfo(); | 345 ~LevelInfo(); |
| 313 | 346 |
| 314 gfx::Rect cleared_rect; | |
| 315 GLenum target; | 347 GLenum target; |
| 316 GLint level; | 348 GLint level; |
| 317 GLenum internal_format; | 349 GLenum internal_format; |
| 318 GLsizei width; | 350 GLsizei width; |
| 319 GLsizei height; | 351 GLsizei height; |
| 320 GLsizei depth; | 352 GLsizei depth; |
| 321 GLint border; | 353 GLint border; |
| 322 GLenum format; | 354 GLenum format; |
| 323 GLenum type; | 355 GLenum type; |
| 324 scoped_refptr<gl::GLImage> image; | |
| 325 scoped_refptr<GLStreamTextureImage> stream_texture_image; | |
| 326 ImageState image_state; | |
| 327 uint32_t estimated_size; | 356 uint32_t estimated_size; |
| 328 bool internal_workaround; | 357 bool internal_workaround; |
| 358 int num_uncleared_layers; |
| 359 |
| 360 std::vector<LayerInfo> layer_infos; |
| 329 }; | 361 }; |
| 330 | 362 |
| 331 struct FaceInfo { | 363 struct FaceInfo { |
| 332 FaceInfo(); | 364 FaceInfo(); |
| 333 FaceInfo(const FaceInfo& other); | 365 FaceInfo(const FaceInfo& other); |
| 334 ~FaceInfo(); | 366 ~FaceInfo(); |
| 335 | 367 |
| 336 // This is relative to base_level and max_level of a texture. | 368 // This is relative to base_level and max_level of a texture. |
| 337 GLsizei num_mip_levels; | 369 GLsizei num_mip_levels; |
| 338 // This contains slots for all levels starting at 0. | 370 // This contains slots for all levels starting at 0. |
| 339 std::vector<LevelInfo> level_infos; | 371 std::vector<LevelInfo> level_infos; |
| 340 }; | 372 }; |
| 341 | 373 |
| 342 // Helper for SetLevel*Image. |stream_texture_image| may be null. | 374 // Helper for SetLevel*Image. |stream_texture_image| may be null. |
| 343 void SetLevelImageInternal(GLenum target, | 375 void SetLevelImageInternal(GLenum target, |
| 344 GLint level, | 376 GLint level, |
| 377 GLint layer, |
| 345 gl::GLImage* image, | 378 gl::GLImage* image, |
| 346 GLStreamTextureImage* stream_texture_image, | 379 GLStreamTextureImage* stream_texture_image, |
| 347 ImageState state); | 380 ImageState state); |
| 348 | 381 |
| 349 // Returns the LevelInfo for |target| and |level| if it's set, else NULL. | 382 // Returns the LevelInfo for |target| and |level| if it's set, else NULL. |
| 350 const LevelInfo* GetLevelInfo(GLint target, GLint level) const; | 383 const LevelInfo* GetLevelInfo(GLint target, GLint level) const; |
| 351 | 384 |
| 352 // Set the info for a particular level. | 385 // Set the info for a particular level. |
| 353 void SetLevelInfo(GLenum target, | 386 void SetLevelInfo(GLenum target, |
| 354 GLint level, | 387 GLint level, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 383 } | 416 } |
| 384 | 417 |
| 385 // Whether or not this texture is a non-power-of-two texture. | 418 // Whether or not this texture is a non-power-of-two texture. |
| 386 bool npot() const { | 419 bool npot() const { |
| 387 return npot_; | 420 return npot_; |
| 388 } | 421 } |
| 389 | 422 |
| 390 // Marks a |rect| of a particular level as cleared. | 423 // Marks a |rect| of a particular level as cleared. |
| 391 void SetLevelClearedRect(GLenum target, | 424 void SetLevelClearedRect(GLenum target, |
| 392 GLint level, | 425 GLint level, |
| 426 GLint layer, |
| 393 const gfx::Rect& cleared_rect); | 427 const gfx::Rect& cleared_rect); |
| 394 | 428 |
| 395 // Marks a particular level as cleared or uncleared. | 429 // Marks a particular level as cleared or uncleared. |
| 396 void SetLevelCleared(GLenum target, GLint level, bool cleared); | 430 void SetLevelCleared(GLenum target, GLint level, GLint layer, bool cleared); |
| 397 | 431 |
| 398 // Updates the cleared flag for this texture by inspecting all the mips. | 432 // Updates the cleared flag for this texture by inspecting all the mips. |
| 399 void UpdateCleared(); | 433 void UpdateCleared(); |
| 400 | 434 |
| 401 // Clears any renderable uncleared levels. | 435 // Clears any renderable uncleared levels. |
| 402 // Returns false if a GL error was generated. | 436 // Returns false if a GL error was generated. |
| 403 bool ClearRenderableLevels(GLES2Decoder* decoder); | 437 bool ClearRenderableLevels(GLES2Decoder* decoder); |
| 404 | 438 |
| 405 // Clears the level. | 439 // Clears the level. |
| 406 // Returns false if a GL error was generated. | 440 // Returns false if a GL error was generated. |
| 407 bool ClearLevel(GLES2Decoder* decoder, GLenum target, GLint level); | 441 bool ClearLevel(GLES2Decoder* decoder, |
| 442 GLenum target, |
| 443 GLint level, |
| 444 GLint layer); |
| 408 | 445 |
| 409 // Sets a texture parameter. | 446 // Sets a texture parameter. |
| 410 // TODO(gman): Expand to SetParameteriv,fv | 447 // TODO(gman): Expand to SetParameteriv,fv |
| 411 // Returns GL_NO_ERROR on success. Otherwise the error to generate. | 448 // Returns GL_NO_ERROR on success. Otherwise the error to generate. |
| 412 GLenum SetParameteri( | 449 GLenum SetParameteri( |
| 413 const FeatureInfo* feature_info, GLenum pname, GLint param); | 450 const FeatureInfo* feature_info, GLenum pname, GLint param); |
| 414 GLenum SetParameterf( | 451 GLenum SetParameterf( |
| 415 const FeatureInfo* feature_info, GLenum pname, GLfloat param); | 452 const FeatureInfo* feature_info, GLenum pname, GLfloat param); |
| 416 | 453 |
| 417 // Makes each of the mip levels as though they were generated. | 454 // Makes each of the mip levels as though they were generated. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 static bool TextureFilterable(const FeatureInfo* feature_info, | 500 static bool TextureFilterable(const FeatureInfo* feature_info, |
| 464 GLenum internal_format, | 501 GLenum internal_format, |
| 465 GLenum type); | 502 GLenum type); |
| 466 | 503 |
| 467 // Sets the Texture's target | 504 // Sets the Texture's target |
| 468 // Parameters: | 505 // Parameters: |
| 469 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP or | 506 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP or |
| 470 // GL_TEXTURE_EXTERNAL_OES or GL_TEXTURE_RECTANGLE_ARB | 507 // GL_TEXTURE_EXTERNAL_OES or GL_TEXTURE_RECTANGLE_ARB |
| 471 // GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D (for GLES3) | 508 // GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D (for GLES3) |
| 472 // max_levels: The maximum levels this type of target can have. | 509 // max_levels: The maximum levels this type of target can have. |
| 473 void SetTarget(GLenum target, GLint max_levels); | 510 void SetTarget(GLenum target, GLint max_levels, GLint layers); |
| 474 | 511 |
| 475 // Update info about this texture. | 512 // Update info about this texture. |
| 476 void Update(); | 513 void Update(); |
| 477 | 514 |
| 478 // Appends a signature for the given level. | 515 // Appends a signature for the given level. |
| 479 void AddToSignature( | 516 void AddToSignature( |
| 480 const FeatureInfo* feature_info, | 517 const FeatureInfo* feature_info, |
| 481 GLenum target, GLint level, std::string* signature) const; | 518 GLenum target, GLint level, GLint layer, std::string* signature) const; |
| 482 | 519 |
| 483 void SetMailboxManager(MailboxManager* mailbox_manager); | 520 void SetMailboxManager(MailboxManager* mailbox_manager); |
| 484 | 521 |
| 485 // Updates the unsafe textures count in all the managers referencing this | 522 // Updates the unsafe textures count in all the managers referencing this |
| 486 // texture. | 523 // texture. |
| 487 void UpdateSafeToRenderFrom(bool cleared); | 524 void UpdateSafeToRenderFrom(bool cleared); |
| 488 | 525 |
| 526 void UpdateMipClearedHelper(LevelInfo* info); |
| 527 |
| 489 // Updates the uncleared mip count in all the managers referencing this | 528 // Updates the uncleared mip count in all the managers referencing this |
| 490 // texture. | 529 // texture. |
| 491 void UpdateMipCleared(LevelInfo* info, | 530 void UpdateMipCleared(LevelInfo* info, |
| 492 GLsizei width, | 531 GLsizei width, |
| 493 GLsizei height, | 532 GLsizei height, |
| 494 const gfx::Rect& cleared_rect); | 533 const gfx::Rect& cleared_rect, |
| 534 GLint layer); |
| 495 | 535 |
| 496 // Computes the CanRenderCondition flag. | 536 // Computes the CanRenderCondition flag. |
| 497 CanRenderCondition GetCanRenderCondition() const; | 537 CanRenderCondition GetCanRenderCondition() const; |
| 498 | 538 |
| 499 // Updates the unrenderable texture count in all the managers referencing this | 539 // Updates the unrenderable texture count in all the managers referencing this |
| 500 // texture. | 540 // texture. |
| 501 void UpdateCanRenderCondition(); | 541 void UpdateCanRenderCondition(); |
| 502 | 542 |
| 503 // Updates the images count in all the managers referencing this | 543 // Updates the images count in all the managers referencing this |
| 504 // texture. | 544 // texture. |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 return max_texture_size_; | 809 return max_texture_size_; |
| 770 case GL_TEXTURE_RECTANGLE: | 810 case GL_TEXTURE_RECTANGLE: |
| 771 return max_rectangle_texture_size_; | 811 return max_rectangle_texture_size_; |
| 772 case GL_TEXTURE_3D: | 812 case GL_TEXTURE_3D: |
| 773 return max_3d_texture_size_; | 813 return max_3d_texture_size_; |
| 774 default: | 814 default: |
| 775 return max_cube_map_texture_size_; | 815 return max_cube_map_texture_size_; |
| 776 } | 816 } |
| 777 } | 817 } |
| 778 | 818 |
| 819 GLsizei max_3d_texture_size() const { |
| 820 return max_3d_texture_size_; |
| 821 } |
| 822 |
| 779 GLsizei max_array_texture_layers() const { | 823 GLsizei max_array_texture_layers() const { |
| 780 return max_array_texture_layers_; | 824 return max_array_texture_layers_; |
| 781 } | 825 } |
| 782 | 826 |
| 783 // Returns the maxium number of levels a texture of the given size can have. | 827 // Returns the maxium number of levels a texture of the given size can have. |
| 784 static GLsizei ComputeMipMapCount(GLenum target, | 828 static GLsizei ComputeMipMapCount(GLenum target, |
| 785 GLsizei width, | 829 GLsizei width, |
| 786 GLsizei height, | 830 GLsizei height, |
| 787 GLsizei depth); | 831 GLsizei depth); |
| 788 | 832 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 | 879 |
| 836 Texture* Produce(TextureRef* ref); | 880 Texture* Produce(TextureRef* ref); |
| 837 | 881 |
| 838 // Maps an existing texture into the texture manager, at a given client ID. | 882 // Maps an existing texture into the texture manager, at a given client ID. |
| 839 TextureRef* Consume(GLuint client_id, Texture* texture); | 883 TextureRef* Consume(GLuint client_id, Texture* texture); |
| 840 | 884 |
| 841 // Sets |rect| of mip as cleared. | 885 // Sets |rect| of mip as cleared. |
| 842 void SetLevelClearedRect(TextureRef* ref, | 886 void SetLevelClearedRect(TextureRef* ref, |
| 843 GLenum target, | 887 GLenum target, |
| 844 GLint level, | 888 GLint level, |
| 889 GLint layer, |
| 845 const gfx::Rect& cleared_rect); | 890 const gfx::Rect& cleared_rect); |
| 846 | 891 |
| 847 // Sets a mip as cleared. | 892 // Sets a mip as cleared. |
| 848 void SetLevelCleared(TextureRef* ref, GLenum target, | 893 void SetLevelCleared(TextureRef* ref, GLenum target, |
| 849 GLint level, bool cleared); | 894 GLint level, GLint layer, bool cleared); |
| 850 | 895 |
| 851 // Sets a texture parameter of a Texture | 896 // Sets a texture parameter of a Texture |
| 852 // Returns GL_NO_ERROR on success. Otherwise the error to generate. | 897 // Returns GL_NO_ERROR on success. Otherwise the error to generate. |
| 853 // TODO(gman): Expand to SetParameteriv,fv | 898 // TODO(gman): Expand to SetParameteriv,fv |
| 854 void SetParameteri( | 899 void SetParameteri( |
| 855 const char* function_name, ErrorState* error_state, | 900 const char* function_name, ErrorState* error_state, |
| 856 TextureRef* ref, GLenum pname, GLint param); | 901 TextureRef* ref, GLenum pname, GLint param); |
| 857 void SetParameterf( | 902 void SetParameterf( |
| 858 const char* function_name, ErrorState* error_state, | 903 const char* function_name, ErrorState* error_state, |
| 859 TextureRef* ref, GLenum pname, GLfloat param); | 904 TextureRef* ref, GLenum pname, GLfloat param); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 } | 978 } |
| 934 } | 979 } |
| 935 | 980 |
| 936 size_t mem_represented() const { | 981 size_t mem_represented() const { |
| 937 return memory_type_tracker_->GetMemRepresented(); | 982 return memory_type_tracker_->GetMemRepresented(); |
| 938 } | 983 } |
| 939 | 984 |
| 940 void SetLevelImage(TextureRef* ref, | 985 void SetLevelImage(TextureRef* ref, |
| 941 GLenum target, | 986 GLenum target, |
| 942 GLint level, | 987 GLint level, |
| 988 GLint layer, |
| 943 gl::GLImage* image, | 989 gl::GLImage* image, |
| 944 Texture::ImageState state); | 990 Texture::ImageState state); |
| 945 | 991 |
| 946 void SetLevelStreamTextureImage(TextureRef* ref, | 992 void SetLevelStreamTextureImage(TextureRef* ref, |
| 947 GLenum target, | 993 GLenum target, |
| 948 GLint level, | 994 GLint level, |
| 995 GLint layer, |
| 949 GLStreamTextureImage* image, | 996 GLStreamTextureImage* image, |
| 950 Texture::ImageState state, | 997 Texture::ImageState state, |
| 951 GLuint service_id); | 998 GLuint service_id); |
| 952 | 999 |
| 953 void SetLevelImageState(TextureRef* ref, | 1000 void SetLevelImageState(TextureRef* ref, |
| 954 GLenum target, | 1001 GLenum target, |
| 955 GLint level, | 1002 GLint level, |
| 1003 GLint layer, |
| 956 Texture::ImageState state); | 1004 Texture::ImageState state); |
| 957 | 1005 |
| 958 size_t GetSignatureSize() const; | 1006 size_t GetSignatureSize() const; |
| 959 | 1007 |
| 960 void AddToSignature( | 1008 void AddToSignature( |
| 961 TextureRef* ref, | 1009 TextureRef* ref, |
| 962 GLenum target, | 1010 GLenum target, |
| 963 GLint level, | 1011 GLint level, |
| 1012 GLint layer, |
| 964 std::string* signature) const; | 1013 std::string* signature) const; |
| 965 | 1014 |
| 966 void AddObserver(DestructionObserver* observer) { | 1015 void AddObserver(DestructionObserver* observer) { |
| 967 destruction_observers_.push_back(observer); | 1016 destruction_observers_.push_back(observer); |
| 968 } | 1017 } |
| 969 | 1018 |
| 970 void RemoveObserver(DestructionObserver* observer) { | 1019 void RemoveObserver(DestructionObserver* observer) { |
| 971 for (unsigned int i = 0; i < destruction_observers_.size(); i++) { | 1020 for (unsigned int i = 0; i < destruction_observers_.size(); i++) { |
| 972 if (destruction_observers_[i] == observer) { | 1021 if (destruction_observers_[i] == observer) { |
| 973 std::swap(destruction_observers_[i], destruction_observers_.back()); | 1022 std::swap(destruction_observers_[i], destruction_observers_.back()); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 private: | 1243 private: |
| 1195 DecoderTextureState* texture_state_; | 1244 DecoderTextureState* texture_state_; |
| 1196 base::TimeTicks begin_time_; | 1245 base::TimeTicks begin_time_; |
| 1197 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 1246 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
| 1198 }; | 1247 }; |
| 1199 | 1248 |
| 1200 } // namespace gles2 | 1249 } // namespace gles2 |
| 1201 } // namespace gpu | 1250 } // namespace gpu |
| 1202 | 1251 |
| 1203 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 1252 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| OLD | NEW |