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 | 9 |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 */ | 177 */ |
178 void drawBitmapCommon(const SkDraw&, | 178 void drawBitmapCommon(const SkDraw&, |
179 const SkBitmap& bitmap, | 179 const SkBitmap& bitmap, |
180 const SkRect* srcRectPtr, | 180 const SkRect* srcRectPtr, |
181 const SkMatrix&, | 181 const SkMatrix&, |
182 const SkPaint&, | 182 const SkPaint&, |
183 SkCanvas::DrawBitmapRectFlags flags); | 183 SkCanvas::DrawBitmapRectFlags flags); |
184 | 184 |
185 /** | 185 /** |
186 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's | 186 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's |
187 * matrix has already been set on GrContext | 187 * matrix, clip, and the device's render target has already been set on GrCo
ntext. |
188 */ | 188 */ |
| 189 |
| 190 // The tileSize and clippedSrcRect will be valid only if true is returned. |
189 bool shouldTileBitmap(const SkBitmap& bitmap, | 191 bool shouldTileBitmap(const SkBitmap& bitmap, |
190 const GrTextureParams& sampler, | 192 const GrTextureParams& sampler, |
191 const SkRect* srcRectPtr, | 193 const SkRect* srcRectPtr, |
192 int maxTileSize, | 194 int maxTileSize, |
193 int* tileSize) const; | 195 int* tileSize, |
| 196 SkIRect* clippedSrcRect) const; |
194 void internalDrawBitmap(const SkBitmap&, | 197 void internalDrawBitmap(const SkBitmap&, |
195 const SkRect&, | 198 const SkRect&, |
196 const GrTextureParams& params, | 199 const GrTextureParams& params, |
197 const SkPaint& paint, | 200 const SkPaint& paint, |
198 SkCanvas::DrawBitmapRectFlags flags); | 201 SkCanvas::DrawBitmapRectFlags flags); |
199 void drawTiledBitmap(const SkBitmap& bitmap, | 202 void drawTiledBitmap(const SkBitmap& bitmap, |
200 const SkRect& srcRect, | 203 const SkRect& srcRect, |
| 204 const SkIRect& clippedSrcRect, |
201 const GrTextureParams& params, | 205 const GrTextureParams& params, |
202 const SkPaint& paint, | 206 const SkPaint& paint, |
203 SkCanvas::DrawBitmapRectFlags flags, | 207 SkCanvas::DrawBitmapRectFlags flags, |
204 int tileSize); | 208 int tileSize); |
205 | 209 |
206 /** | 210 /** |
207 * Returns non-initialized instance. | 211 * Returns non-initialized instance. |
208 */ | 212 */ |
209 GrTextContext* getTextContext(); | 213 GrTextContext* getTextContext(); |
210 | 214 |
211 typedef SkBitmapDevice INHERITED; | 215 typedef SkBitmapDevice INHERITED; |
212 }; | 216 }; |
213 | 217 |
214 #endif | 218 #endif |
OLD | NEW |