OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 SkGpuDevice_DEFINED | 8 #ifndef SkGpuDevice_DEFINED |
9 #define SkGpuDevice_DEFINED | 9 #define SkGpuDevice_DEFINED |
10 | 10 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 void prepareDraw(const SkDraw&); | 172 void prepareDraw(const SkDraw&); |
173 | 173 |
174 /** | 174 /** |
175 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's | 175 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's |
176 * matrix, clip, and the device's render target has already been set on GrCo
ntext. | 176 * matrix, clip, and the device's render target has already been set on GrCo
ntext. |
177 */ | 177 */ |
178 | 178 |
179 // The tileSize and clippedSrcRect will be valid only if true is returned. | 179 // The tileSize and clippedSrcRect will be valid only if true is returned. |
180 bool shouldTileImageID(uint32_t imageID, const SkIRect& imageRect, | 180 bool shouldTileImageID(uint32_t imageID, const SkIRect& imageRect, |
181 const SkMatrix& viewMatrix, | 181 const SkMatrix& viewMatrix, |
| 182 const SkMatrix& srcToDstRectMatrix, |
182 const GrTextureParams& params, | 183 const GrTextureParams& params, |
183 const SkRect* srcRectPtr, | 184 const SkRect* srcRectPtr, |
184 int maxTileSize, | 185 int maxTileSize, |
185 int* tileSize, | 186 int* tileSize, |
186 SkIRect* clippedSubset) const; | 187 SkIRect* clippedSubset) const; |
187 bool shouldTileBitmap(const SkBitmap& bitmap, | |
188 const SkMatrix& viewMatrix, | |
189 const GrTextureParams& sampler, | |
190 const SkRect* srcRectPtr, | |
191 int maxTileSize, | |
192 int* tileSize, | |
193 SkIRect* clippedSrcRect) const; | |
194 // Just returns the predicate, not the out-tileSize or out-clippedSubset, as
they are not | 188 // Just returns the predicate, not the out-tileSize or out-clippedSubset, as
they are not |
195 // needed at the moment. | 189 // needed at the moment. |
196 bool shouldTileImage(const SkImage* image, const SkRect* srcRectPtr, | 190 bool shouldTileImage(const SkImage* image, const SkRect* srcRectPtr, |
197 SkCanvas::SrcRectConstraint constraint, SkFilterQuality
quality, | 191 SkCanvas::SrcRectConstraint constraint, SkFilterQuality
quality, |
198 const SkMatrix& viewMatrix) const; | 192 const SkMatrix& viewMatrix, const SkMatrix& srcToDstRec
t) const; |
199 | |
200 void internalDrawBitmap(const SkBitmap&, | |
201 const SkMatrix& viewMatrix, | |
202 const SkRect&, | |
203 const GrTextureParams& params, | |
204 const SkPaint& paint, | |
205 SkCanvas::SrcRectConstraint, | |
206 bool bicubic, | |
207 bool needsTextureDomain); | |
208 | 193 |
209 sk_sp<SkSpecialImage> filterTexture(const SkDraw&, | 194 sk_sp<SkSpecialImage> filterTexture(const SkDraw&, |
210 SkSpecialImage*, | 195 SkSpecialImage*, |
211 int left, int top, | 196 int left, int top, |
212 SkIPoint* offset, | 197 SkIPoint* offset, |
213 const SkImageFilter* filter); | 198 const SkImageFilter* filter); |
214 | 199 |
| 200 // Splits bitmap into tiles of tileSize and draws them using separate textur
es for each tile. |
215 void drawTiledBitmap(const SkBitmap& bitmap, | 201 void drawTiledBitmap(const SkBitmap& bitmap, |
216 const SkMatrix& viewMatrix, | 202 const SkMatrix& viewMatrix, |
| 203 const SkMatrix& srcToDstMatrix, |
217 const SkRect& srcRect, | 204 const SkRect& srcRect, |
218 const SkIRect& clippedSrcRect, | 205 const SkIRect& clippedSrcRect, |
219 const GrTextureParams& params, | 206 const GrTextureParams& params, |
220 const SkPaint& paint, | 207 const SkPaint& paint, |
221 SkCanvas::SrcRectConstraint, | 208 SkCanvas::SrcRectConstraint, |
222 int tileSize, | 209 int tileSize, |
223 bool bicubic); | 210 bool bicubic); |
224 | 211 |
| 212 // Used by drawTiledBitmap to draw each tile. |
| 213 void drawBitmapTile(const SkBitmap&, |
| 214 const SkMatrix& viewMatrix, |
| 215 const SkRect& dstRect, |
| 216 const SkRect& srcRect, |
| 217 const GrTextureParams& params, |
| 218 const SkPaint& paint, |
| 219 SkCanvas::SrcRectConstraint, |
| 220 bool bicubic, |
| 221 bool needsTextureDomain); |
| 222 |
225 void drawTextureProducer(GrTextureProducer*, | 223 void drawTextureProducer(GrTextureProducer*, |
226 const SkRect* srcRect, | 224 const SkRect* srcRect, |
227 const SkRect* dstRect, | 225 const SkRect* dstRect, |
228 SkCanvas::SrcRectConstraint, | 226 SkCanvas::SrcRectConstraint, |
229 const SkMatrix& viewMatrix, | 227 const SkMatrix& viewMatrix, |
230 const GrClip&, | 228 const GrClip&, |
231 const SkPaint&); | 229 const SkPaint&); |
232 | 230 |
233 void drawTextureProducerImpl(GrTextureProducer*, | 231 void drawTextureProducerImpl(GrTextureProducer*, |
234 const SkRect& clippedSrcRect, | 232 const SkRect& clippedSrcRect, |
(...skipping 19 matching lines...) Expand all Loading... |
254 int sampleCount, | 252 int sampleCount, |
255 GrSurfaceOrigin, | 253 GrSurfaceOrigin, |
256 const SkSurfaceProps*); | 254 const SkSurfaceProps*); |
257 | 255 |
258 friend class GrAtlasTextContext; | 256 friend class GrAtlasTextContext; |
259 friend class SkSurface_Gpu; // for access to surfaceProps | 257 friend class SkSurface_Gpu; // for access to surfaceProps |
260 typedef SkBaseDevice INHERITED; | 258 typedef SkBaseDevice INHERITED; |
261 }; | 259 }; |
262 | 260 |
263 #endif | 261 #endif |
OLD | NEW |