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

Unified Diff: tests/RecordingXfermodeTest.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « tests/RecordOptsTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RecordingXfermodeTest.cpp
diff --git a/tests/RecordingXfermodeTest.cpp b/tests/RecordingXfermodeTest.cpp
index 0f91aea9648589e97bfdd82438555022b90a7433..32aec36f9f712995a421a070fad6e9252833df8f 100644
--- a/tests/RecordingXfermodeTest.cpp
+++ b/tests/RecordingXfermodeTest.cpp
@@ -34,7 +34,7 @@ class Drawer {
const SkImageInfo& imageInfo() const { return fImageInfo; }
- void draw(SkCanvas* canvas, const SkRect& clipRect, SkXfermode::Mode mode) const {
+ void draw(SkCanvas* canvas, const SkRect& clipRect, SkBlendMode mode) const {
SkPaint greenPaint;
greenPaint.setColor(0xff008000);
SkPaint blackPaint;
@@ -43,7 +43,7 @@ class Drawer {
whitePaint.setColor(0xffffffff);
SkPaint layerPaint;
layerPaint.setColor(0xff000000);
- layerPaint.setXfermodeMode(mode);
+ layerPaint.setBlendMode(mode);
SkRect canvasRect(SkRect::MakeWH(SkIntToScalar(fImageInfo.width()),
SkIntToScalar(fImageInfo.height())));
@@ -68,7 +68,7 @@ class RecordingStrategy {
virtual ~RecordingStrategy() {}
virtual const SkBitmap& recordAndReplay(const Drawer& drawer,
const SkRect& intoClip,
- SkXfermode::Mode) = 0;
+ SkBlendMode) = 0;
};
class BitmapBackedCanvasStrategy : public RecordingStrategy {
@@ -78,9 +78,8 @@ class BitmapBackedCanvasStrategy : public RecordingStrategy {
fBitmap.allocPixels(imageInfo);
}
- virtual const SkBitmap& recordAndReplay(const Drawer& drawer,
- const SkRect& intoClip,
- SkXfermode::Mode mode) {
+ const SkBitmap& recordAndReplay(const Drawer& drawer, const SkRect& intoClip,
+ SkBlendMode mode) override {
SkCanvas canvas(fBitmap);
canvas.clear(0xffffffff);
// Note that the scene is drawn just into the clipped region!
@@ -104,9 +103,8 @@ class PictureStrategy : public RecordingStrategy {
fHeight = imageInfo.height();
}
- virtual const SkBitmap& recordAndReplay(const Drawer& drawer,
- const SkRect& intoClip,
- SkXfermode::Mode mode) {
+ const SkBitmap& recordAndReplay(const Drawer& drawer, const SkRect& intoClip,
+ SkBlendMode mode) override {
SkRTreeFactory factory;
SkPictureRecorder recorder;
SkRect canvasRect(SkRect::MakeWH(SkIntToScalar(fWidth),SkIntToScalar(fHeight)));
@@ -144,9 +142,9 @@ DEF_TEST(SkRecordingAccuracyXfermode, reporter) {
SkString errors;
#endif
- for (int iMode = 0; iMode < int(SkXfermode::kLastMode); iMode++) {
+ for (int iMode = 0; iMode < int(SkBlendMode::kLastMode); iMode++) {
const SkRect& clip = SkRect::MakeXYWH(100, 0, 100, 100);
- SkXfermode::Mode mode = SkXfermode::Mode(iMode);
+ SkBlendMode mode = SkBlendMode(iMode);
const SkBitmap& goldenBM = golden.recordAndReplay(drawer, clip, mode);
const SkBitmap& pictureBM = picture.recordAndReplay(drawer, clip, mode);
« no previous file with comments | « tests/RecordOptsTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698