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). |
281 */ | 282 */ |
282 bool copySurface(GrSurface* dst, | 283 void copySurface(GrSurface* dst, |
283 GrSurface* src, | 284 GrSurface* src, |
284 const SkIRect& srcRect, | 285 const SkIRect& srcRect, |
285 const SkIPoint& dstPoint); | 286 const SkIPoint& dstPoint, |
| 287 uint32_t pixelOpsFlags = 0); |
286 | 288 |
287 /** Helper that copies the whole surface but fails when the two surfaces are
not identically | 289 /** Helper that copies the whole surface but fails when the two surfaces are
not identically |
288 sized. */ | 290 sized. */ |
289 bool copySurface(GrSurface* dst, GrSurface* src) { | 291 bool copySurface(GrSurface* dst, GrSurface* src) { |
290 return this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->he
ight()), | 292 if (NULL == dst || NULL == src || dst->width() != src->width() || |
291 SkIPoint::Make(0,0)); | 293 dst->height() != src->height()) { |
| 294 return false; |
| 295 } |
| 296 this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->height())
, |
| 297 SkIPoint::Make(0,0)); |
| 298 return true; |
292 } | 299 } |
293 | 300 |
294 /** | 301 /** |
295 * After this returns any pending writes to the surface will have been issue
d to the backend 3D API. | 302 * After this returns any pending writes to the surface will have been issue
d to the backend 3D API. |
296 */ | 303 */ |
297 void flushSurfaceWrites(GrSurface* surface); | 304 void flushSurfaceWrites(GrSurface* surface); |
298 | 305 |
299 /** | 306 /** |
300 * Finalizes all pending reads and writes to the surface and also performs a
n MSAA resolve | 307 * Finalizes all pending reads and writes to the surface and also performs a
n MSAA resolve |
301 * if necessary. | 308 * if necessary. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 /** | 453 /** |
447 * A callback similar to the above for use by the TextBlobCache | 454 * A callback similar to the above for use by the TextBlobCache |
448 * TODO move textblob draw calls below context so we can use the call above. | 455 * TODO move textblob draw calls below context so we can use the call above. |
449 */ | 456 */ |
450 static void TextBlobCacheOverBudgetCB(void* data); | 457 static void TextBlobCacheOverBudgetCB(void* data); |
451 | 458 |
452 typedef SkRefCnt INHERITED; | 459 typedef SkRefCnt INHERITED; |
453 }; | 460 }; |
454 | 461 |
455 #endif | 462 #endif |
OLD | NEW |