OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkGpuDevice_DEFINED | 9 #ifndef SkGpuDevice_DEFINED |
10 #define SkGpuDevice_DEFINED | 10 #define SkGpuDevice_DEFINED |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 const SkSize* dstSizePtr, // ignored iff srcRectP
tr == nullptr | 187 const SkSize* dstSizePtr, // ignored iff srcRectP
tr == nullptr |
188 const SkPaint&, | 188 const SkPaint&, |
189 SkCanvas::SrcRectConstraint); | 189 SkCanvas::SrcRectConstraint); |
190 | 190 |
191 /** | 191 /** |
192 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's | 192 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's |
193 * matrix, clip, and the device's render target has already been set on GrCo
ntext. | 193 * matrix, clip, and the device's render target has already been set on GrCo
ntext. |
194 */ | 194 */ |
195 | 195 |
196 // The tileSize and clippedSrcRect will be valid only if true is returned. | 196 // The tileSize and clippedSrcRect will be valid only if true is returned. |
| 197 bool shouldTileImageID(uint32_t imageID, const SkIRect& imageRect, |
| 198 const SkMatrix& viewMatrix, |
| 199 const GrTextureParams& params, |
| 200 const SkRect* srcRectPtr, |
| 201 int maxTileSize, |
| 202 int* tileSize, |
| 203 SkIRect* clippedSubset) const; |
197 bool shouldTileBitmap(const SkBitmap& bitmap, | 204 bool shouldTileBitmap(const SkBitmap& bitmap, |
198 const SkMatrix& viewMatrix, | 205 const SkMatrix& viewMatrix, |
199 const GrTextureParams& sampler, | 206 const GrTextureParams& sampler, |
200 const SkRect* srcRectPtr, | 207 const SkRect* srcRectPtr, |
201 int maxTileSize, | 208 int maxTileSize, |
202 int* tileSize, | 209 int* tileSize, |
203 SkIRect* clippedSrcRect) const; | 210 SkIRect* clippedSrcRect) const; |
| 211 // Just returns the predicate, not the out-tileSize or out-clippedSubset, as
they are not |
| 212 // needed at the moment. |
| 213 bool shouldTileImage(const SkImage* image, const SkRect* srcRectPtr, |
| 214 SkCanvas::SrcRectConstraint constraint, SkFilterQuality
quality, |
| 215 const SkMatrix& viewMatrix) const; |
| 216 |
204 void internalDrawBitmap(const SkBitmap&, | 217 void internalDrawBitmap(const SkBitmap&, |
205 const SkMatrix& viewMatrix, | 218 const SkMatrix& viewMatrix, |
206 const SkRect&, | 219 const SkRect&, |
207 const GrTextureParams& params, | 220 const GrTextureParams& params, |
208 const SkPaint& paint, | 221 const SkPaint& paint, |
209 SkCanvas::SrcRectConstraint, | 222 SkCanvas::SrcRectConstraint, |
210 bool bicubic, | 223 bool bicubic, |
211 bool needsTextureDomain); | 224 bool needsTextureDomain); |
212 void drawTiledBitmap(const SkBitmap& bitmap, | 225 void drawTiledBitmap(const SkBitmap& bitmap, |
213 const SkMatrix& viewMatrix, | 226 const SkMatrix& viewMatrix, |
214 const SkRect& srcRect, | 227 const SkRect& srcRect, |
215 const SkIRect& clippedSrcRect, | 228 const SkIRect& clippedSrcRect, |
216 const GrTextureParams& params, | 229 const GrTextureParams& params, |
217 const SkPaint& paint, | 230 const SkPaint& paint, |
218 SkCanvas::SrcRectConstraint, | 231 SkCanvas::SrcRectConstraint, |
219 int tileSize, | 232 int tileSize, |
220 bool bicubic); | 233 bool bicubic); |
221 | 234 |
222 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 235 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
223 | 236 |
224 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, | 237 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, |
225 int sampleCount); | 238 int sampleCount); |
226 | 239 |
227 friend class GrAtlasTextContext; | 240 friend class GrAtlasTextContext; |
228 friend class SkSurface_Gpu; // for access to surfaceProps | 241 friend class SkSurface_Gpu; // for access to surfaceProps |
229 typedef SkBaseDevice INHERITED; | 242 typedef SkBaseDevice INHERITED; |
230 }; | 243 }; |
231 | 244 |
232 #endif | 245 #endif |
OLD | NEW |