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

Unified Diff: dm/DMSrcSink.cpp

Issue 1441753002: Replace SkFunction with std::function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | gyp/core.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 358124782a3584537d4256d4e87e049e6489c7c4..c9178c06dc68dc888ab9e37456771dc194a31729 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -14,7 +14,6 @@
#include "SkData.h"
#include "SkDocument.h"
#include "SkError.h"
-#include "SkFunction.h"
#include "SkImageGenerator.h"
#include "SkMultiPictureDraw.h"
#include "SkNullCanvas.h"
@@ -30,6 +29,7 @@
#include "SkTLogic.h"
#include "SkXMLWriter.h"
#include "SkSwizzler.h"
+#include <functional>
DEFINE_bool(multiPage, false, "For document-type backends, render the source"
" into multiple pages");
@@ -1058,16 +1058,16 @@ Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) con
// Several examples below.
static Error draw_to_canvas(Sink* sink, SkBitmap* bitmap, SkWStream* stream, SkString* log,
- SkISize size, SkFunction<Error(SkCanvas*)> draw) {
+ SkISize size, std::function<Error(SkCanvas*)> draw) {
class ProxySrc : public Src {
public:
- ProxySrc(SkISize size, SkFunction<Error(SkCanvas*)> draw) : fSize(size), fDraw(draw) {}
+ ProxySrc(SkISize size, std::function<Error(SkCanvas*)> draw) : fSize(size), fDraw(draw) {}
Error draw(SkCanvas* canvas) const override { return fDraw(canvas); }
Name name() const override { sk_throw(); return ""; } // Won't be called.
SkISize size() const override { return fSize; }
private:
- SkISize fSize;
- SkFunction<Error(SkCanvas*)> fDraw;
+ SkISize fSize;
+ std::function<Error(SkCanvas*)> fDraw;
};
return sink->draw(ProxySrc(size, draw), bitmap, stream, log);
}
« no previous file with comments | « no previous file | gyp/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698