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

Side by Side Diff: src/core/SkSpecialImage.h

Issue 2163343002: Adding color space to SkSpecialImage (Closed) Base URL: https://skia.googlesource.com/skia.git@colorspace-on-image
Patch Set: Fix compile after rebase Created 4 years, 5 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 | « src/core/SkImageFilter.cpp ('k') | src/core/SkSpecialImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file 5 * found in the LICENSE file
6 */ 6 */
7 7
8 #ifndef SkSpecialImage_DEFINED 8 #ifndef SkSpecialImage_DEFINED
9 #define SkSpecialImage_DEFINED 9 #define SkSpecialImage_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class SkSpecialImage : public SkRefCnt { 43 class SkSpecialImage : public SkRefCnt {
44 public: 44 public:
45 typedef void* ReleaseContext; 45 typedef void* ReleaseContext;
46 typedef void(*RasterReleaseProc)(void* pixels, ReleaseContext); 46 typedef void(*RasterReleaseProc)(void* pixels, ReleaseContext);
47 47
48 const SkSurfaceProps& props() const { return fProps; } 48 const SkSurfaceProps& props() const { return fProps; }
49 49
50 int width() const { return fSubset.width(); } 50 int width() const { return fSubset.width(); }
51 int height() const { return fSubset.height(); } 51 int height() const { return fSubset.height(); }
52 const SkIRect& subset() const { return fSubset; } 52 const SkIRect& subset() const { return fSubset; }
53 SkColorSpace* getColorSpace() const;
53 54
54 uint32_t uniqueID() const { return fUniqueID; } 55 uint32_t uniqueID() const { return fUniqueID; }
55 virtual bool isOpaque() const { return false; } 56 virtual bool isOpaque() const { return false; }
56 virtual size_t getSize() const = 0; 57 virtual size_t getSize() const = 0;
57 58
58 /** 59 /**
59 * Ensures that a special image is backed by a texture (when GrContext is n on-null). If no 60 * Ensures that a special image is backed by a texture (when GrContext is n on-null). If no
60 * transformation is required, the returned image may be the same as this s pecial image. 61 * transformation is required, the returned image may be the same as this s pecial image.
61 * If this special image is from a different GrContext, this will fail. 62 * If this special image is from a different GrContext, this will fail.
62 */ 63 */
63 sk_sp<SkSpecialImage> makeTextureImage(GrContext*); 64 sk_sp<SkSpecialImage> makeTextureImage(GrContext*);
64 65
65 /** 66 /**
66 * Draw this SpecialImage into the canvas. 67 * Draw this SpecialImage into the canvas.
67 */ 68 */
68 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const; 69 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const;
69 70
70 static sk_sp<SkSpecialImage> MakeFromImage(const SkIRect& subset, 71 static sk_sp<SkSpecialImage> MakeFromImage(const SkIRect& subset,
71 sk_sp<SkImage>, 72 sk_sp<SkImage>,
72 const SkSurfaceProps* = nullptr); 73 const SkSurfaceProps* = nullptr);
73 static sk_sp<SkSpecialImage> MakeFromRaster(const SkIRect& subset, 74 static sk_sp<SkSpecialImage> MakeFromRaster(const SkIRect& subset,
74 const SkBitmap&, 75 const SkBitmap&,
75 const SkSurfaceProps* = nullptr) ; 76 const SkSurfaceProps* = nullptr) ;
76 #if SK_SUPPORT_GPU 77 #if SK_SUPPORT_GPU
77 static sk_sp<SkSpecialImage> MakeFromGpu(const SkIRect& subset, 78 static sk_sp<SkSpecialImage> MakeFromGpu(const SkIRect& subset,
78 uint32_t uniqueID, 79 uint32_t uniqueID,
79 sk_sp<GrTexture>, 80 sk_sp<GrTexture>,
81 sk_sp<SkColorSpace>,
80 const SkSurfaceProps* = nullptr, 82 const SkSurfaceProps* = nullptr,
81 SkAlphaType at = kPremul_SkAlphaTyp e); 83 SkAlphaType at = kPremul_SkAlphaTyp e);
82 #endif 84 #endif
83 85
84 /** 86 /**
85 * Create a new special surface with a backend that is compatible with this special image. 87 * Create a new special surface with a backend that is compatible with this special image.
86 */ 88 */
87 sk_sp<SkSpecialSurface> makeSurface(const SkImageInfo&) const; 89 sk_sp<SkSpecialSurface> makeSurface(const SkImageInfo&) const;
88 90
89 /** 91 /**
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 140
139 private: 141 private:
140 const SkSurfaceProps fProps; 142 const SkSurfaceProps fProps;
141 const SkIRect fSubset; 143 const SkIRect fSubset;
142 const uint32_t fUniqueID; 144 const uint32_t fUniqueID;
143 145
144 typedef SkRefCnt INHERITED; 146 typedef SkRefCnt INHERITED;
145 }; 147 };
146 148
147 #endif 149 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/core/SkSpecialImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698