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

Side by Side Diff: tests/ImageTest.cpp

Issue 1512333002: SkPixelSerializer: remove deprecated virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « include/core/SkPixelSerializer.h ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 public: 162 public:
163 MockSerializer(SkData* (*func)()) : fFunc(func), fDidEncode(false) { } 163 MockSerializer(SkData* (*func)()) : fFunc(func), fDidEncode(false) { }
164 164
165 bool didEncode() const { return fDidEncode; } 165 bool didEncode() const { return fDidEncode; }
166 166
167 protected: 167 protected:
168 bool onUseEncodedData(const void*, size_t) override { 168 bool onUseEncodedData(const void*, size_t) override {
169 return false; 169 return false;
170 } 170 }
171 171
172 SkData* onEncodePixels(const SkImageInfo&, const void*, size_t) override { 172 SkData* onEncode(const SkPixmap&) override {
173 fDidEncode = true; 173 fDidEncode = true;
174 return fFunc(); 174 return fFunc();
175 } 175 }
176 176
177 private: 177 private:
178 SkData* (*fFunc)(); 178 SkData* (*fFunc)();
179 bool fDidEncode; 179 bool fDidEncode;
180 180
181 typedef SkPixelSerializer INHERITED; 181 typedef SkPixelSerializer INHERITED;
182 }; 182 };
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 check_image_color(reporter, refImg, expected1); 667 check_image_color(reporter, refImg, expected1);
668 #endif 668 #endif
669 check_image_color(reporter, cpyImg, expected0); 669 check_image_color(reporter, cpyImg, expected0);
670 670
671 // Now exercise the release proc 671 // Now exercise the release proc
672 REPORTER_ASSERT(reporter, 0 == releaseChecker.fReleaseCount); 672 REPORTER_ASSERT(reporter, 0 == releaseChecker.fReleaseCount);
673 refImg.reset(nullptr); // force a release of the image 673 refImg.reset(nullptr); // force a release of the image
674 REPORTER_ASSERT(reporter, 1 == releaseChecker.fReleaseCount); 674 REPORTER_ASSERT(reporter, 1 == releaseChecker.fReleaseCount);
675 } 675 }
676 #endif 676 #endif
OLDNEW
« no previous file with comments | « include/core/SkPixelSerializer.h ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698