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

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

Issue 874353007: cc: Remove SkSurface cache from Resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renamed function from Get to Create Created 5 years, 11 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/gpu_rasterizer.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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ~ScopedWriteLockGr(); 336 ~ScopedWriteLockGr();
337 337
338 SkSurface* GetSkSurface(bool use_distance_field_text, 338 skia::RefPtr<SkSurface> CreateSkSurface(bool use_distance_field_text,
339 bool can_use_lcd_text); 339 bool can_use_lcd_text);
reveman 2015/01/27 21:29:04 Sorry for not thinking of this at first but creati
340 340
341 private: 341 private:
342 bool SurfaceHasMatchingProperties(bool use_distance_field_text,
343 bool can_use_lcd_text) const;
344
345 ResourceProvider* resource_provider_; 342 ResourceProvider* resource_provider_;
346 ResourceProvider::Resource* resource_; 343 ResourceProvider::Resource* resource_;
347 base::ThreadChecker thread_checker_; 344 base::ThreadChecker thread_checker_;
348 345
349 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr); 346 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr);
350 }; 347 };
351 348
352 class Fence : public base::RefCounted<Fence> { 349 class Fence : public base::RefCounted<Fence> {
353 public: 350 public:
354 Fence() {} 351 Fence() {}
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 unsigned image_id; 484 unsigned image_id;
488 unsigned bound_image_id; 485 unsigned bound_image_id;
489 GLenum texture_pool; 486 GLenum texture_pool;
490 GLint wrap_mode; 487 GLint wrap_mode;
491 TextureHint hint; 488 TextureHint hint;
492 ResourceType type; 489 ResourceType type;
493 ResourceFormat format; 490 ResourceFormat format;
494 SharedBitmapId shared_bitmap_id; 491 SharedBitmapId shared_bitmap_id;
495 SharedBitmap* shared_bitmap; 492 SharedBitmap* shared_bitmap;
496 gfx::GpuMemoryBuffer* gpu_memory_buffer; 493 gfx::GpuMemoryBuffer* gpu_memory_buffer;
497 skia::RefPtr<SkSurface> sk_surface;
498 }; 494 };
499 typedef base::hash_map<ResourceId, Resource> ResourceMap; 495 typedef base::hash_map<ResourceId, Resource> ResourceMap;
500 496
501 static bool CompareResourceMapIteratorsByChildId( 497 static bool CompareResourceMapIteratorsByChildId(
502 const std::pair<ReturnedResource, ResourceMap::iterator>& a, 498 const std::pair<ReturnedResource, ResourceMap::iterator>& a,
503 const std::pair<ReturnedResource, ResourceMap::iterator>& b); 499 const std::pair<ReturnedResource, ResourceMap::iterator>& b);
504 500
505 struct Child { 501 struct Child {
506 Child(); 502 Child();
507 ~Child(); 503 ~Child();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 return format_gl_data_format[format]; 647 return format_gl_data_format[format];
652 } 648 }
653 649
654 inline GLenum GLInternalFormat(ResourceFormat format) { 650 inline GLenum GLInternalFormat(ResourceFormat format) {
655 return GLDataFormat(format); 651 return GLDataFormat(format);
656 } 652 }
657 653
658 } // namespace cc 654 } // namespace cc
659 655
660 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 656 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/resources/gpu_rasterizer.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698