Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: include/gpu/GrContext.h

Issue 1690053002: Revert of Make copySurface work for texture dsts, return a bool, & add unit test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrDrawContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 4245b7fa943cc894cb216f609f1e767116264777..00a92836c513d6ef9963cc9d3ca925101a2a489a 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -278,17 +278,24 @@
* @param src the surface to copy from.
* @param srcRect the rectangle of the src that should be copied.
* @param dstPoint the translation applied when writing the srcRect's pixels to the dst.
- */
- bool copySurface(GrSurface* dst,
+ * @param pixelOpsFlags see PixelOpsFlags enum above. (kUnpremul_PixelOpsFlag is not allowed).
+ */
+ void copySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
- const SkIPoint& dstPoint);
+ const SkIPoint& dstPoint,
+ uint32_t pixelOpsFlags = 0);
/** Helper that copies the whole surface but fails when the two surfaces are not identically
sized. */
bool copySurface(GrSurface* dst, GrSurface* src) {
- return this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->height()),
- SkIPoint::Make(0,0));
+ if (NULL == dst || NULL == src || dst->width() != src->width() ||
+ dst->height() != src->height()) {
+ return false;
+ }
+ this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->height()),
+ SkIPoint::Make(0,0));
+ return true;
}
/**
« no previous file with comments | « no previous file | include/gpu/GrDrawContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698