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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 size_t rowBytes, | 271 size_t rowBytes, |
272 uint32_t pixelOpsFlags = 0); | 272 uint32_t pixelOpsFlags = 0); |
273 | 273 |
274 /** | 274 /** |
275 * Copies a rectangle of texels from src to dst. | 275 * Copies a rectangle of texels from src to dst. |
276 * bounds. | 276 * bounds. |
277 * @param dst the surface to copy to. | 277 * @param dst the surface to copy to. |
278 * @param src the surface to copy from. | 278 * @param src the surface to copy from. |
279 * @param srcRect the rectangle of the src that should be copied. | 279 * @param srcRect the rectangle of the src that should be copied. |
280 * @param dstPoint the translation applied when writing the srcRect's p
ixels to the dst. | 280 * @param dstPoint the translation applied when writing the srcRect's p
ixels to the dst. |
281 * @param pixelOpsFlags see PixelOpsFlags enum above. (kUnpremul_PixelOpsFla
g is not allowed). | |
282 */ | 281 */ |
283 void copySurface(GrSurface* dst, | 282 bool copySurface(GrSurface* dst, |
284 GrSurface* src, | 283 GrSurface* src, |
285 const SkIRect& srcRect, | 284 const SkIRect& srcRect, |
286 const SkIPoint& dstPoint, | 285 const SkIPoint& dstPoint); |
287 uint32_t pixelOpsFlags = 0); | |
288 | 286 |
289 /** Helper that copies the whole surface but fails when the two surfaces are
not identically | 287 /** Helper that copies the whole surface but fails when the two surfaces are
not identically |
290 sized. */ | 288 sized. */ |
291 bool copySurface(GrSurface* dst, GrSurface* src) { | 289 bool copySurface(GrSurface* dst, GrSurface* src) { |
292 if (NULL == dst || NULL == src || dst->width() != src->width() || | 290 return this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->he
ight()), |
293 dst->height() != src->height()) { | 291 SkIPoint::Make(0,0)); |
294 return false; | |
295 } | |
296 this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->height())
, | |
297 SkIPoint::Make(0,0)); | |
298 return true; | |
299 } | 292 } |
300 | 293 |
301 /** | 294 /** |
302 * After this returns any pending writes to the surface will have been issue
d to the backend 3D API. | 295 * After this returns any pending writes to the surface will have been issue
d to the backend 3D API. |
303 */ | 296 */ |
304 void flushSurfaceWrites(GrSurface* surface); | 297 void flushSurfaceWrites(GrSurface* surface); |
305 | 298 |
306 /** | 299 /** |
307 * Finalizes all pending reads and writes to the surface and also performs a
n MSAA resolve | 300 * Finalizes all pending reads and writes to the surface and also performs a
n MSAA resolve |
308 * if necessary. | 301 * if necessary. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 /** | 446 /** |
454 * A callback similar to the above for use by the TextBlobCache | 447 * A callback similar to the above for use by the TextBlobCache |
455 * TODO move textblob draw calls below context so we can use the call above. | 448 * TODO move textblob draw calls below context so we can use the call above. |
456 */ | 449 */ |
457 static void TextBlobCacheOverBudgetCB(void* data); | 450 static void TextBlobCacheOverBudgetCB(void* data); |
458 | 451 |
459 typedef SkRefCnt INHERITED; | 452 typedef SkRefCnt INHERITED; |
460 }; | 453 }; |
461 | 454 |
462 #endif | 455 #endif |
OLD | NEW |