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

Unified Diff: dm/DMSrcSink.cpp

Issue 1269093002: remove SkDeferredCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « dm/DM.cpp ('k') | gyp/utils.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index f766b49c79395acceaba2dbff4cec8794e46f43f..5b2ccc8f5763af9d08c51ea46e0bbb5bfcc0805e 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -10,7 +10,6 @@
#include "SkCodec.h"
#include "SkCommonFlags.h"
#include "SkData.h"
-#include "SkDeferredCanvas.h"
#include "SkDocument.h"
#include "SkError.h"
#include "SkFunction.h"
@@ -874,37 +873,13 @@ Error ViaPipe::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStrin
return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) {
PipeController controller(canvas, &SkImageDecoder::DecodeMemory);
SkGPipeWriter pipe;
- const uint32_t kFlags = 0; // We mirror SkDeferredCanvas, which doesn't use any flags.
+ const uint32_t kFlags = 0;
return src.draw(pipe.startRecording(&controller, kFlags, size.width(), size.height()));
});
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-Error ViaDeferred::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
- // We draw via a deferred canvas into a surface that's compatible with the original canvas,
- // then snap that surface as an image and draw it into the original canvas.
- return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* canvas) -> Error {
- SkAutoTUnref<SkSurface> surface(canvas->newSurface(canvas->imageInfo()));
- if (!surface.get()) {
- return "can't make surface for deferred canvas";
- }
- SkAutoTDelete<SkDeferredCanvas> defcan(SkDeferredCanvas::Create(surface));
- Error err = src.draw(defcan);
- if (!err.isEmpty()) {
- return err;
- }
- SkAutoTUnref<SkImage> image(defcan->newImageSnapshot());
- if (!image) {
- return "failed to create deferred image snapshot";
- }
- canvas->drawImage(image, 0, 0, NULL);
- return "";
- });
-}
-
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
Error ViaSerialization::draw(
const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
// Record our Src into a picture.
« no previous file with comments | « dm/DM.cpp ('k') | gyp/utils.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698