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

Unified Diff: src/pipe/SkPipeCanvas.h

Issue 2335973003: change write-image to use pipeverbs like everyone else, and add test (Closed)
Patch Set: switch to [define_image] write_image Created 4 years, 3 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 | « no previous file | src/pipe/SkPipeCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkPipeCanvas.h
diff --git a/src/pipe/SkPipeCanvas.h b/src/pipe/SkPipeCanvas.h
index 25353c922fd9e9d68a16a5c254773fdf4293764c..8dbb83fe203247044c3fa7f17c404315dc6212ca 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;
« no previous file with comments | « no previous file | src/pipe/SkPipeCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698