aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-01-28 11:01:06 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-28 11:01:06 -0800
commit772604c214e8c12ee16d2eb60f4b7acbcdd2129e (patch)
tree11929f0113e557b4449ad770e4c80d1f8d301469
parent3dc40ac9f968eee95eef5e8ee811e0640691df0f (diff)
Add a flag to flush the canvases during SkMultiPictureDraw::draw().
This is necessary for multisampling, so that each multisampled render target resolves before Chrome's compositor attempts to draw the texture. BUG=skia: Review URL: https://codereview.chromium.org/878653004
-rw-r--r--include/core/SkMultiPictureDraw.h5
-rw-r--r--src/core/SkMultiPictureDraw.cpp5
2 files changed, 7 insertions, 3 deletions
diff --git a/include/core/SkMultiPictureDraw.h b/include/core/SkMultiPictureDraw.h
index ce788962ff..809e2dfe29 100644
--- a/include/core/SkMultiPictureDraw.h
+++ b/include/core/SkMultiPictureDraw.h
@@ -45,9 +45,10 @@ public:
/**
* Perform all the previously added draws. This will reset the state
- * of this object.
+ * of this object. If flush is true, all canvases are flushed after
+ * draw.
*/
- void draw();
+ void draw(bool flush = false);
/**
* Abandon all buffered draws and reset to the initial state.
diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp
index c85c56735c..7cdab7300c 100644
--- a/src/core/SkMultiPictureDraw.cpp
+++ b/src/core/SkMultiPictureDraw.cpp
@@ -86,7 +86,7 @@ public:
//#define FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING
-void SkMultiPictureDraw::draw() {
+void SkMultiPictureDraw::draw(bool flush) {
AutoMPDReset mpdreset(this);
#ifdef FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING
@@ -192,6 +192,9 @@ void SkMultiPictureDraw::draw() {
{
canvas->drawPicture(picture, &data.fMatrix, data.fPaint);
}
+ if (flush) {
+ canvas->flush();
+ }
}
#if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU