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

Unified Diff: cc/resources/resource_provider.h

Issue 2752523006: cc: Use SkCreateColorSpaceXformCanvas for color transforms (Closed)
Patch Set: Rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/raster/zero_copy_raster_buffer_provider.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index 4fc6bd67807fde0c6853773bfe7ac9088d0c66fd..eddfc63e0f1db9213d1c35c2145eb782b6832aa1 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -288,7 +288,11 @@ class CC_EXPORT ResourceProvider
GLenum target() const { return target_; }
ResourceFormat format() const { return format_; }
const gfx::Size& size() const { return size_; }
- sk_sp<SkColorSpace> sk_color_space() const { return sk_color_space_; }
+ // Will return the invalid color space unless
+ // |enable_color_correct_rasterization| is true.
+ const gfx::ColorSpace& color_space_for_raster() const {
+ return color_space_;
+ }
const TextureMailbox& mailbox() const { return mailbox_; }
@@ -311,7 +315,7 @@ class CC_EXPORT ResourceProvider
bool has_sync_token_;
bool synchronized_;
base::ThreadChecker thread_checker_;
- sk_sp<SkColorSpace> sk_color_space_;
+ gfx::ColorSpace color_space_;
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGL);
};
@@ -399,13 +403,17 @@ class CC_EXPORT ResourceProvider
SkBitmap& sk_bitmap() { return sk_bitmap_; }
bool valid() const { return !!sk_bitmap_.getPixels(); }
- sk_sp<SkColorSpace> sk_color_space() const { return sk_color_space_; }
+ // Will return the invalid color space unless
+ // |enable_color_correct_rasterization| is true.
+ const gfx::ColorSpace& color_space_for_raster() const {
+ return color_space_;
+ }
private:
ResourceProvider* resource_provider_;
ResourceId resource_id_;
SkBitmap sk_bitmap_;
- sk_sp<SkColorSpace> sk_color_space_;
+ gfx::ColorSpace color_space_;
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware);
@@ -417,7 +425,11 @@ class CC_EXPORT ResourceProvider
ResourceId resource_id);
~ScopedWriteLockGpuMemoryBuffer();
gfx::GpuMemoryBuffer* GetGpuMemoryBuffer();
- sk_sp<SkColorSpace> sk_color_space() const { return sk_color_space_; }
+ // Will return the invalid color space unless
+ // |enable_color_correct_rasterization| is true.
+ const gfx::ColorSpace& color_space_for_raster() const {
+ return color_space_;
+ }
private:
ResourceProvider* resource_provider_;
@@ -426,7 +438,7 @@ class CC_EXPORT ResourceProvider
gfx::BufferUsage usage_;
gfx::Size size_;
std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer_;
- sk_sp<SkColorSpace> sk_color_space_;
+ gfx::ColorSpace color_space_;
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer);
@@ -723,8 +735,10 @@ class CC_EXPORT ResourceProvider
gpu::gles2::GLES2Interface* ContextGL() const;
bool IsGLContextLost() const;
- // Returns null if |settings_.enable_color_correct_rasterization| is false.
- sk_sp<SkColorSpace> GetResourceSkColorSpace(const Resource* resource) const;
+ // Will return the invalid color space unless
+ // |enable_color_correct_rasterization| is true.
+ gfx::ColorSpace GetResourceColorSpaceForRaster(
+ const Resource* resource) const;
// Holds const settings for the ResourceProvider. Never changed after init.
struct Settings {
« no previous file with comments | « cc/raster/zero_copy_raster_buffer_provider.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698