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

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

Issue 23023005: cc: refcount resources as we send them to the parent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 4 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
« no previous file with comments | « cc/output/delegating_renderer_unittest.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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 unsigned gl_id; 348 unsigned gl_id;
349 // Pixel buffer used for set pixels without unnecessary copying. 349 // Pixel buffer used for set pixels without unnecessary copying.
350 unsigned gl_pixel_buffer_id; 350 unsigned gl_pixel_buffer_id;
351 // Query used to determine when asynchronous set pixels complete. 351 // Query used to determine when asynchronous set pixels complete.
352 unsigned gl_upload_query_id; 352 unsigned gl_upload_query_id;
353 TextureMailbox mailbox; 353 TextureMailbox mailbox;
354 uint8_t* pixels; 354 uint8_t* pixels;
355 uint8_t* pixel_buffer; 355 uint8_t* pixel_buffer;
356 int lock_for_read_count; 356 int lock_for_read_count;
357 int imported_count;
358 int exported_count;
357 bool locked_for_write; 359 bool locked_for_write;
358 bool external; 360 bool external;
359 bool exported;
360 bool marked_for_deletion; 361 bool marked_for_deletion;
361 bool pending_set_pixels; 362 bool pending_set_pixels;
362 bool set_pixels_completion_forced; 363 bool set_pixels_completion_forced;
363 bool allocated; 364 bool allocated;
364 bool enable_read_lock_fences; 365 bool enable_read_lock_fences;
365 scoped_refptr<Fence> read_lock_fence; 366 scoped_refptr<Fence> read_lock_fence;
366 gfx::Size size; 367 gfx::Size size;
367 GLenum format; 368 GLenum format;
368 // TODO(skyostil): Use a separate sampler object for filter state. 369 // TODO(skyostil): Use a separate sampler object for filter state.
369 GLenum filter; 370 GLenum filter;
(...skipping 22 matching lines...) Expand all
392 393
393 void CleanUpGLIfNeeded(); 394 void CleanUpGLIfNeeded();
394 395
395 const Resource* LockForRead(ResourceId id); 396 const Resource* LockForRead(ResourceId id);
396 void UnlockForRead(ResourceId id); 397 void UnlockForRead(ResourceId id);
397 const Resource* LockForWrite(ResourceId id); 398 const Resource* LockForWrite(ResourceId id);
398 void UnlockForWrite(ResourceId id); 399 void UnlockForWrite(ResourceId id);
399 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, 400 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap,
400 const Resource* resource); 401 const Resource* resource);
401 402
402 bool TransferResource(WebKit::WebGraphicsContext3D* context, 403 void TransferResource(WebKit::WebGraphicsContext3D* context,
403 ResourceId id, 404 ResourceId id,
404 TransferableResource* resource); 405 TransferableResource* resource);
405 enum DeleteStyle { 406 enum DeleteStyle {
406 Normal, 407 Normal,
407 ForShutdown, 408 ForShutdown,
408 }; 409 };
409 void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style); 410 void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style);
410 void LazyCreate(Resource* resource); 411 void LazyCreate(Resource* resource);
411 void LazyAllocate(Resource* resource); 412 void LazyAllocate(Resource* resource);
412 413
(...skipping 29 matching lines...) Expand all
442 base::ThreadChecker thread_checker_; 443 base::ThreadChecker thread_checker_;
443 444
444 scoped_refptr<Fence> current_read_lock_fence_; 445 scoped_refptr<Fence> current_read_lock_fence_;
445 446
446 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 447 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
447 }; 448 };
448 449
449 } // namespace cc 450 } // namespace cc
450 451
451 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 452 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/output/delegating_renderer_unittest.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698