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

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

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/pixel_buffer_tile_task_worker_pool.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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 gfx::Size size_; 325 gfx::Size size_;
326 ResourceFormat format_; 326 ResourceFormat format_;
327 base::ThreadChecker thread_checker_; 327 base::ThreadChecker thread_checker_;
328 328
329 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); 329 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer);
330 }; 330 };
331 331
332 class CC_EXPORT ScopedWriteLockGr { 332 class CC_EXPORT ScopedWriteLockGr {
333 public: 333 public:
334 ScopedWriteLockGr(ResourceProvider* resource_provider, 334 ScopedWriteLockGr(ResourceProvider* resource_provider,
335 ResourceProvider::ResourceId resource_id); 335 ResourceProvider::ResourceId resource_id,
336 bool use_distance_field_text,
337 bool can_use_lcd_text,
338 int msaa_sample_count);
336 ~ScopedWriteLockGr(); 339 ~ScopedWriteLockGr();
337 340
338 SkSurface* GetSkSurface(bool use_distance_field_text, 341 SkSurface* get_sk_surface() { return sk_surface_.get(); }
339 bool can_use_lcd_text);
340 342
341 private: 343 private:
342 bool SurfaceHasMatchingProperties(bool use_distance_field_text,
343 bool can_use_lcd_text) const;
344
345 ResourceProvider* resource_provider_; 344 ResourceProvider* resource_provider_;
346 ResourceProvider::Resource* resource_; 345 ResourceProvider::Resource* resource_;
347 base::ThreadChecker thread_checker_; 346 base::ThreadChecker thread_checker_;
347 skia::RefPtr<SkSurface> sk_surface_;
348 348
349 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr); 349 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr);
350 }; 350 };
351 351
352 class Fence : public base::RefCounted<Fence> { 352 class Fence : public base::RefCounted<Fence> {
353 public: 353 public:
354 Fence() {} 354 Fence() {}
355 355
356 virtual void Set() = 0; 356 virtual void Set() = 0;
357 virtual bool HasPassed() = 0; 357 virtual bool HasPassed() = 0;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 unsigned image_id; 487 unsigned image_id;
488 unsigned bound_image_id; 488 unsigned bound_image_id;
489 GLenum texture_pool; 489 GLenum texture_pool;
490 GLint wrap_mode; 490 GLint wrap_mode;
491 TextureHint hint; 491 TextureHint hint;
492 ResourceType type; 492 ResourceType type;
493 ResourceFormat format; 493 ResourceFormat format;
494 SharedBitmapId shared_bitmap_id; 494 SharedBitmapId shared_bitmap_id;
495 SharedBitmap* shared_bitmap; 495 SharedBitmap* shared_bitmap;
496 gfx::GpuMemoryBuffer* gpu_memory_buffer; 496 gfx::GpuMemoryBuffer* gpu_memory_buffer;
497 skia::RefPtr<SkSurface> sk_surface;
498 }; 497 };
499 typedef base::hash_map<ResourceId, Resource> ResourceMap; 498 typedef base::hash_map<ResourceId, Resource> ResourceMap;
500 499
501 static bool CompareResourceMapIteratorsByChildId( 500 static bool CompareResourceMapIteratorsByChildId(
502 const std::pair<ReturnedResource, ResourceMap::iterator>& a, 501 const std::pair<ReturnedResource, ResourceMap::iterator>& a,
503 const std::pair<ReturnedResource, ResourceMap::iterator>& b); 502 const std::pair<ReturnedResource, ResourceMap::iterator>& b);
504 503
505 struct Child { 504 struct Child {
506 Child(); 505 Child();
507 ~Child(); 506 ~Child();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 return format_gl_data_format[format]; 650 return format_gl_data_format[format];
652 } 651 }
653 652
654 inline GLenum GLInternalFormat(ResourceFormat format) { 653 inline GLenum GLInternalFormat(ResourceFormat format) {
655 return GLDataFormat(format); 654 return GLDataFormat(format);
656 } 655 }
657 656
658 } // namespace cc 657 } // namespace cc
659 658
660 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 659 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/resources/pixel_buffer_tile_task_worker_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698