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

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

Issue 14409006: cc: Changes to use GL API for GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@glapi
Patch Set: Cosmetic fixes Created 7 years, 7 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
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 // Update pixels from acquired pixel buffer. 286 // Update pixels from acquired pixel buffer.
287 void SetPixelsFromBuffer(ResourceId id); 287 void SetPixelsFromBuffer(ResourceId id);
288 288
289 // Asynchronously update pixels from acquired pixel buffer. 289 // Asynchronously update pixels from acquired pixel buffer.
290 void BeginSetPixels(ResourceId id); 290 void BeginSetPixels(ResourceId id);
291 void ForceSetPixelsToComplete(ResourceId id); 291 void ForceSetPixelsToComplete(ResourceId id);
292 bool DidSetPixelsComplete(ResourceId id); 292 bool DidSetPixelsComplete(ResourceId id);
293 void AbortSetPixels(ResourceId id); 293 void AbortSetPixels(ResourceId id);
294 294
295 // Methods for GLImage zero-copy API.
reveman 2013/05/20 23:16:01 I think these functions could need a bit more of a
kaanb 2013/05/21 00:52:29 Done.
296 void AcquireImage(ResourceId id);
297 void ReleaseImage(ResourceId id);
298 uint8_t* MapImage(ResourceId id);
299 void UnmapImage(ResourceId id);
300 void BindImage(ResourceId id);
301 int GetImageStride(ResourceId id);
302
295 // For tests only! This prevents detecting uninitialized reads. 303 // For tests only! This prevents detecting uninitialized reads.
296 // Use SetPixels or LockForWrite to allocate implicitly. 304 // Use SetPixels or LockForWrite to allocate implicitly.
297 void AllocateForTesting(ResourceId id); 305 void AllocateForTesting(ResourceId id);
298 306
299 // Sets the current read fence. If a resource is locked for read 307 // Sets the current read fence. If a resource is locked for read
300 // and has read fences enabled, the resource will not allow writes 308 // and has read fences enabled, the resource will not allow writes
301 // until this fence has passed. 309 // until this fence has passed.
302 void SetReadLockFence(scoped_refptr<Fence> fence) { 310 void SetReadLockFence(scoped_refptr<Fence> fence) {
303 current_read_lock_fence_ = fence; 311 current_read_lock_fence_ = fence;
304 } 312 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 bool marked_for_deletion; 348 bool marked_for_deletion;
341 bool pending_set_pixels; 349 bool pending_set_pixels;
342 bool set_pixels_completion_forced; 350 bool set_pixels_completion_forced;
343 bool allocated; 351 bool allocated;
344 bool enable_read_lock_fences; 352 bool enable_read_lock_fences;
345 scoped_refptr<Fence> read_lock_fence; 353 scoped_refptr<Fence> read_lock_fence;
346 gfx::Size size; 354 gfx::Size size;
347 GLenum format; 355 GLenum format;
348 // TODO(skyostil): Use a separate sampler object for filter state. 356 // TODO(skyostil): Use a separate sampler object for filter state.
349 GLenum filter; 357 GLenum filter;
358 unsigned image_id;
350 ResourceType type; 359 ResourceType type;
351 }; 360 };
352 typedef base::hash_map<ResourceId, Resource> ResourceMap; 361 typedef base::hash_map<ResourceId, Resource> ResourceMap;
353 struct Child { 362 struct Child {
354 Child(); 363 Child();
355 ~Child(); 364 ~Child();
356 365
357 ResourceIdMap child_to_parent_map; 366 ResourceIdMap child_to_parent_map;
358 ResourceIdMap parent_to_child_map; 367 ResourceIdMap parent_to_child_map;
359 }; 368 };
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 base::ThreadChecker thread_checker_; 414 base::ThreadChecker thread_checker_;
406 415
407 scoped_refptr<Fence> current_read_lock_fence_; 416 scoped_refptr<Fence> current_read_lock_fence_;
408 417
409 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 418 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
410 }; 419 };
411 420
412 } // namespace cc 421 } // namespace cc
413 422
414 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 423 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698