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

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

Issue 12665005: cc: Use highp precision for texture coords if available and needed (Closed) Base URL: http://git.chromium.org/chromium/src.git@highp2
Patch Set: rebase after all dependencies landed Created 7 years, 8 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
« no previous file with comments | « cc/resources/prioritized_resource_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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap; 48 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap;
49 enum TextureUsageHint { 49 enum TextureUsageHint {
50 TextureUsageAny, 50 TextureUsageAny,
51 TextureUsageFramebuffer, 51 TextureUsageFramebuffer,
52 }; 52 };
53 enum ResourceType { 53 enum ResourceType {
54 GLTexture = 1, 54 GLTexture = 1,
55 Bitmap, 55 Bitmap,
56 }; 56 };
57 57
58 static scoped_ptr<ResourceProvider> Create(OutputSurface* output_surface); 58 static scoped_ptr<ResourceProvider> Create(OutputSurface* output_surface,
59 int highp_threshold_min);
59 60
60 virtual ~ResourceProvider(); 61 virtual ~ResourceProvider();
61 62
62 WebKit::WebGraphicsContext3D* GraphicsContext3D(); 63 WebKit::WebGraphicsContext3D* GraphicsContext3D();
63 TextureCopier* texture_copier() const { return texture_copier_.get(); } 64 TextureCopier* texture_copier() const { return texture_copier_.get(); }
64 int max_texture_size() const { return max_texture_size_; } 65 int max_texture_size() const { return max_texture_size_; }
65 GLenum best_texture_format() const { return best_texture_format_; } 66 GLenum best_texture_format() const { return best_texture_format_; }
66 unsigned num_resources() const { return resources_.size(); } 67 unsigned num_resources() const { return resources_.size(); }
67 68
68 // Checks whether a resource is in use by a consumer. 69 // Checks whether a resource is in use by a consumer.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 ResourceIdMap parent_to_child_map; 350 ResourceIdMap parent_to_child_map;
350 }; 351 };
351 typedef base::hash_map<int, Child> ChildMap; 352 typedef base::hash_map<int, Child> ChildMap;
352 353
353 bool ReadLockFenceHasPassed(Resource* resource) { 354 bool ReadLockFenceHasPassed(Resource* resource) {
354 return !resource->read_lock_fence || 355 return !resource->read_lock_fence ||
355 resource->read_lock_fence->HasPassed(); 356 resource->read_lock_fence->HasPassed();
356 } 357 }
357 358
358 explicit ResourceProvider(OutputSurface* output_surface); 359 explicit ResourceProvider(OutputSurface* output_surface);
359 bool Initialize(); 360 bool Initialize(int highp_threshold_min);
360 361
361 const Resource* LockForRead(ResourceId id); 362 const Resource* LockForRead(ResourceId id);
362 void UnlockForRead(ResourceId id); 363 void UnlockForRead(ResourceId id);
363 const Resource* LockForWrite(ResourceId id); 364 const Resource* LockForWrite(ResourceId id);
364 void UnlockForWrite(ResourceId id); 365 void UnlockForWrite(ResourceId id);
365 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, 366 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap,
366 const Resource* resource); 367 const Resource* resource);
367 368
368 bool TransferResource(WebKit::WebGraphicsContext3D* context, 369 bool TransferResource(WebKit::WebGraphicsContext3D* context,
369 ResourceId id, 370 ResourceId id,
(...skipping 21 matching lines...) Expand all
391 base::ThreadChecker thread_checker_; 392 base::ThreadChecker thread_checker_;
392 393
393 scoped_refptr<Fence> current_read_lock_fence_; 394 scoped_refptr<Fence> current_read_lock_fence_;
394 395
395 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 396 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
396 }; 397 };
397 398
398 } // namespace cc 399 } // namespace cc
399 400
400 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 401 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/resources/prioritized_resource_unittest.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698