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

Side by Side Diff: cc/proto/skia_conversions_unittest.cc

Issue 2575583002: Remove ClipPathDisplayItem::clip_op_ (Closed)
Patch Set: rebase Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/proto/skia_conversions.h" 5 #include "cc/proto/skia_conversions.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/proto/skregion.pb.h" 9 #include "cc/proto/skregion.pb.h"
10 #include "cc/proto/skrrect.pb.h" 10 #include "cc/proto/skrrect.pb.h"
11 #include "cc/proto/skxfermode.pb.h" 11 #include "cc/proto/skxfermode.pb.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "third_party/skia/include/core/SkBlendMode.h" 13 #include "third_party/skia/include/core/SkBlendMode.h"
14 #include "third_party/skia/include/core/SkClipOp.h"
15 #include "third_party/skia/include/core/SkRRect.h" 14 #include "third_party/skia/include/core/SkRRect.h"
16 15
17 namespace cc { 16 namespace cc {
18 namespace { 17 namespace {
19 18
20 TEST(SkiaProtoConversionsTest, SerializeDeserializeSkClipOp) {
21 // explicitly list the clipops, as this list will be reduced overtime
22 // as skia constricts the valid ops for clipping
23 // https://bugs.chromium.org/p/skia/issues/detail?id=3191
24 const SkClipOp ops[] = {
25 SkClipOp::kDifference, SkClipOp::kIntersect,
26 };
27 for (SkClipOp op : ops) {
28 EXPECT_EQ(op, SkClipOpFromProto(SkClipOpToProto(op)));
29 }
30 }
31
32 TEST(SkiaProtoConversionsTest, SerializeDeserializeSkXfermodeMode) { 19 TEST(SkiaProtoConversionsTest, SerializeDeserializeSkXfermodeMode) {
33 for (size_t i = 0; i < static_cast<size_t>(SkBlendMode::kLastMode); i++) { 20 for (size_t i = 0; i < static_cast<size_t>(SkBlendMode::kLastMode); i++) {
34 SkBlendMode mode = static_cast<SkBlendMode>(i); 21 SkBlendMode mode = static_cast<SkBlendMode>(i);
35 EXPECT_EQ(mode, SkXfermodeModeFromProto(SkXfermodeModeToProto(mode))); 22 EXPECT_EQ(mode, SkXfermodeModeFromProto(SkXfermodeModeToProto(mode)));
36 } 23 }
37 } 24 }
38 25
39 TEST(SkiaProtoConversionsTest, SerializeDeserializeSkRRect) { 26 TEST(SkiaProtoConversionsTest, SerializeDeserializeSkRRect) {
40 SkRect rect = SkRect::MakeXYWH(0, 10, 15, 20); 27 SkRect rect = SkRect::MakeXYWH(0, 10, 15, 20);
41 SkVector radii[4]; 28 SkVector radii[4];
(...skipping 29 matching lines...) Expand all
71 proto.radii_lower_left().x()); 58 proto.radii_lower_left().x());
72 EXPECT_EQ(rrect.radii(SkRRect::kLowerLeft_Corner).y(), 59 EXPECT_EQ(rrect.radii(SkRRect::kLowerLeft_Corner).y(),
73 proto.radii_lower_left().y()); 60 proto.radii_lower_left().y());
74 61
75 // Test ProtoToRRect 62 // Test ProtoToRRect
76 EXPECT_EQ(rrect, ProtoToSkRRect(proto)); 63 EXPECT_EQ(rrect, ProtoToSkRRect(proto));
77 } 64 }
78 65
79 } // namespace 66 } // namespace
80 } // namespace cc 67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/proto/skia_conversions.cc ('k') | third_party/WebKit/Source/platform/graphics/paint/ClipPathDisplayItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698