aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pipe/SkPipeCanvas.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-09-13 17:25:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-13 17:25:19 -0700
commit7e3ba9f88d64d901243799b61f497319e5970693 (patch)
treeda3ffd0aa8b6c67bd46c0cc16c881bf1e503143c /src/pipe/SkPipeCanvas.h
parent21cc9950c4b4eb183c315c7d417e36342a9f1cf9 (diff)
change write-image to use pipeverbs like everyone else, and add test
Diffstat (limited to 'src/pipe/SkPipeCanvas.h')
-rw-r--r--src/pipe/SkPipeCanvas.h5
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;