diff options
author | reed <reed@google.com> | 2016-09-13 17:25:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-13 17:25:19 -0700 |
commit | 7e3ba9f88d64d901243799b61f497319e5970693 (patch) | |
tree | da3ffd0aa8b6c67bd46c0cc16c881bf1e503143c /src/pipe/SkPipeCanvas.h | |
parent | 21cc9950c4b4eb183c315c7d417e36342a9f1cf9 (diff) |
change write-image to use pipeverbs like everyone else, and add test
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335973003
Review-Url: https://codereview.chromium.org/2335973003
Diffstat (limited to 'src/pipe/SkPipeCanvas.h')
-rw-r--r-- | src/pipe/SkPipeCanvas.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pipe/SkPipeCanvas.h b/src/pipe/SkPipeCanvas.h index 25353c922f..8dbb83fe20 100644 --- a/src/pipe/SkPipeCanvas.h +++ b/src/pipe/SkPipeCanvas.h @@ -23,7 +23,7 @@ public: void reset() { fArray.reset(); } // returns the found index or 0 - int find(const T& key) { + int find(const T& key) const { const Rec* stop = fArray.end(); for (const Rec* curr = fArray.begin(); curr < stop; ++curr) { if (key == curr->fKey) { @@ -64,6 +64,9 @@ public: void setStream(SkWStream* stream) { fStream = stream; } void setTypefaceSerializer(SkTypefaceSerializer* tfs) { fTFSerializer = tfs; } + // returns 0 if not found + int findImage(SkImage* image) const { return fImages.find(image->uniqueID()); } + int findOrDefineImage(SkImage*) override; int findOrDefinePicture(SkPicture*) override; int findOrDefineTypeface(SkTypeface*) override; |