OLD | NEW |
---|---|
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 | 358 |
359 // Indicates if we can currently lock this resource for write. | 359 // Indicates if we can currently lock this resource for write. |
360 bool CanLockForWrite(ResourceId id); | 360 bool CanLockForWrite(ResourceId id); |
361 | 361 |
362 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); | 362 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); |
363 | 363 |
364 private: | 364 private: |
365 struct Resource { | 365 struct Resource { |
366 Resource(); | 366 Resource(); |
367 ~Resource(); | 367 ~Resource(); |
368 enum Origin { | |
danakj
2014/01/28 21:59:02
This seems like an odd place, in the middle of the
| |
369 Internal, | |
370 External, | |
371 Delegated, | |
372 }; | |
368 Resource(unsigned texture_id, | 373 Resource(unsigned texture_id, |
369 gfx::Size size, | 374 gfx::Size size, |
375 Origin origin, | |
370 GLenum target, | 376 GLenum target, |
371 GLenum filter, | 377 GLenum filter, |
372 GLenum texture_pool, | 378 GLenum texture_pool, |
373 GLint wrap_mode, | 379 GLint wrap_mode, |
374 TextureUsageHint hint, | 380 TextureUsageHint hint, |
375 ResourceFormat format); | 381 ResourceFormat format); |
376 Resource(uint8_t* pixels, | 382 Resource(uint8_t* pixels, |
377 SharedBitmap* bitmap, | 383 SharedBitmap* bitmap, |
378 gfx::Size size, | 384 gfx::Size size, |
385 Origin origin, | |
379 GLenum filter, | 386 GLenum filter, |
380 GLint wrap_mode); | 387 GLint wrap_mode); |
381 | 388 |
382 int child_id; | 389 int child_id; |
383 unsigned gl_id; | 390 unsigned gl_id; |
384 // Pixel buffer used for set pixels without unnecessary copying. | 391 // Pixel buffer used for set pixels without unnecessary copying. |
385 unsigned gl_pixel_buffer_id; | 392 unsigned gl_pixel_buffer_id; |
386 // Query used to determine when asynchronous set pixels complete. | 393 // Query used to determine when asynchronous set pixels complete. |
387 unsigned gl_upload_query_id; | 394 unsigned gl_upload_query_id; |
388 TextureMailbox mailbox; | 395 TextureMailbox mailbox; |
389 ReleaseCallback release_callback; | 396 ReleaseCallback release_callback; |
390 uint8_t* pixels; | 397 uint8_t* pixels; |
391 uint8_t* pixel_buffer; | 398 uint8_t* pixel_buffer; |
392 int lock_for_read_count; | 399 int lock_for_read_count; |
393 int imported_count; | 400 int imported_count; |
394 int exported_count; | 401 int exported_count; |
395 bool locked_for_write; | 402 bool locked_for_write; |
396 enum Origin { | |
397 Internal, | |
398 External, | |
399 Delegated, | |
400 }; | |
401 Origin origin; | 403 Origin origin; |
402 bool marked_for_deletion; | 404 bool marked_for_deletion; |
403 bool pending_set_pixels; | 405 bool pending_set_pixels; |
404 bool set_pixels_completion_forced; | 406 bool set_pixels_completion_forced; |
405 bool allocated; | 407 bool allocated; |
406 bool enable_read_lock_fences; | 408 bool enable_read_lock_fences; |
407 scoped_refptr<Fence> read_lock_fence; | 409 scoped_refptr<Fence> read_lock_fence; |
408 gfx::Size size; | 410 gfx::Size size; |
409 GLenum target; | 411 GLenum target; |
410 // TODO(skyostil): Use a separate sampler object for filter state. | 412 // TODO(skyostil): Use a separate sampler object for filter state. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
557 return format_gl_data_format[format]; | 559 return format_gl_data_format[format]; |
558 } | 560 } |
559 | 561 |
560 inline GLenum GLInternalFormat(ResourceFormat format) { | 562 inline GLenum GLInternalFormat(ResourceFormat format) { |
561 return GLDataFormat(format); | 563 return GLDataFormat(format); |
562 } | 564 } |
563 | 565 |
564 } // namespace cc | 566 } // namespace cc |
565 | 567 |
566 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 568 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |