diff options
author | Matt Sarett <msarett@google.com> | 2017-03-29 16:25:10 -0400 |
---|---|---|
committer | Matt Sarett <msarett@google.com> | 2017-04-06 15:14:00 +0000 |
commit | ea70d22dc8dc5d61f075edf6d03f86f6a68169cd (patch) | |
tree | 076905e7bf8d2a09631a597d8c1c4975964e8ab6 /libs/hwui/SkiaCanvas.h | |
parent | 3cc32f2aa205db9770c694a823f6d9a532ff0901 (diff) |
Xform bitmaps to sRGB on SW and PDF canvases
For picture-backed canvases, we will defer the xform
until playback.
Test: Unit tests and cts test.
Bug: 32984164
Change-Id: Ib74663bcb688b74b6ba8792b403b0475126732af
Diffstat (limited to 'libs/hwui/SkiaCanvas.h')
-rw-r--r-- | libs/hwui/SkiaCanvas.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/SkiaCanvas.h b/libs/hwui/SkiaCanvas.h index 34c3717557ff..13f979cf7d71 100644 --- a/libs/hwui/SkiaCanvas.h +++ b/libs/hwui/SkiaCanvas.h @@ -37,8 +37,12 @@ public: * @param canvas SkCanvas to handle calls made to this SkiaCanvas. Must * not be NULL. This constructor does not take ownership, so the caller * must guarantee that it remains valid while the SkiaCanvas is valid. + * @param xformToSRGB Indicates if bitmaps should be xformed to the sRGB + * color space before drawing. This makes sense for software rendering. + * For the picture case, it may make more sense to leave bitmaps as is, + * and handle the xform when replaying the picture. */ - explicit SkiaCanvas(SkCanvas* canvas); + explicit SkiaCanvas(SkCanvas* canvas, XformToSRGB xformToSRGB); virtual ~SkiaCanvas(); @@ -181,6 +185,7 @@ private: class Clip; + std::unique_ptr<SkCanvas> mCanvasWrapper; // might own a wrapper on the canvas std::unique_ptr<SkCanvas> mCanvasOwned; // might own a canvas we allocated SkCanvas* mCanvas; // we do NOT own this canvas, it must survive us // unless it is the same as mCanvasOwned.get() |