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

Side by Side Diff: include/core/SkImage.h

Issue 821083002: add newImage API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add SkFilterQuality option 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 SkImage_DEFINED 8 #ifndef SkImage_DEFINED
9 #define SkImage_DEFINED 9 #define SkImage_DEFINED
10 10
11 #include "SkFilterQuality.h"
11 #include "SkImageInfo.h" 12 #include "SkImageInfo.h"
12 #include "SkImageEncoder.h" 13 #include "SkImageEncoder.h"
13 #include "SkRefCnt.h" 14 #include "SkRefCnt.h"
14 #include "SkScalar.h" 15 #include "SkScalar.h"
15 #include "SkShader.h" 16 #include "SkShader.h"
16 17
17 class SkData; 18 class SkData;
18 class SkCanvas; 19 class SkCanvas;
19 class SkImageGenerator; 20 class SkImageGenerator;
20 class SkPaint; 21 class SkPaint;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 122
122 /** 123 /**
123 * Return a new surface that is compatible with this image's internal repre sentation 124 * Return a new surface that is compatible with this image's internal repre sentation
124 * (e.g. raster or gpu). 125 * (e.g. raster or gpu).
125 * 126 *
126 * If no surfaceprops are specified, the image will attempt to match the pr ops of when it 127 * If no surfaceprops are specified, the image will attempt to match the pr ops of when it
127 * was created (if it came from a surface). 128 * was created (if it came from a surface).
128 */ 129 */
129 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps* = NULL) cons t; 130 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps* = NULL) cons t;
130 131
132 /**
133 * Return an image that is a rescale of this image (using newWidth, newHeig ht).
134 *
135 * If subset is NULL, then the entire original image is used as the src for the scaling.
136 * If subset is not NULL, then it specifies subset of src-pixels used for s caling. If
137 * subset extends beyond the bounds of the original image, then NULL is ret urned.
138 *
139 * Note: it is legal for the returned image to be the same instance as the src image
140 * (if the new dimensions == the src dimensions and any subset encloses the entire src).
scroggo 2015/01/05 16:15:33 This comment seems to conflict with the code and t
reed1 2015/01/05 21:58:14 Done.
141 */
142 SkImage* newImage(int newWidth, int newHeight, const SkIRect* subset = NULL,
143 SkFilterQuality = kNone_SkFilterQuality) const;
144
131 protected: 145 protected:
132 SkImage(int width, int height) : 146 SkImage(int width, int height) :
133 fWidth(width), 147 fWidth(width),
134 fHeight(height), 148 fHeight(height),
135 fUniqueID(NextUniqueID()) { 149 fUniqueID(NextUniqueID()) {
136 150
137 SkASSERT(width > 0); 151 SkASSERT(width > 0);
138 SkASSERT(height > 0); 152 SkASSERT(height > 0);
139 } 153 }
140 154
(...skipping 14 matching lines...) Expand all
155 * Draw the image, cropped to the src rect, to the dst rect of a canvas. 169 * Draw the image, cropped to the src rect, to the dst rect of a canvas.
156 * If src is larger than the bounds of the image, the rest of the image is 170 * If src is larger than the bounds of the image, the rest of the image is
157 * filled with transparent black pixels. 171 * filled with transparent black pixels.
158 * 172 *
159 * See SkCanvas::drawBitmapRectToRect for similar behavior. 173 * See SkCanvas::drawBitmapRectToRect for similar behavior.
160 */ 174 */
161 void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint *) const; 175 void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint *) const;
162 }; 176 };
163 177
164 #endif 178 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698