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

Unified Diff: content/common/cc_messages_unittest.cc

Issue 21154002: Add support for converting cc::FilterOperations into an SkImageFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | « content/common/cc_messages.cc ('k') | webkit/renderer/compositor_bindings/web_filter_operations_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/cc_messages_unittest.cc
diff --git a/content/common/cc_messages_unittest.cc b/content/common/cc_messages_unittest.cc
index 6be248da55b174b22d79da622775c48b84602961..1bb93cc70c74a9a9923c7b149f236df3721f1800 100644
--- a/content/common/cc_messages_unittest.cc
+++ b/content/common/cc_messages_unittest.cc
@@ -136,11 +136,16 @@ class CCMessagesTest : public testing::Test {
EXPECT_EQ(a->contents_changed_since_last_frame,
b->contents_changed_since_last_frame);
EXPECT_EQ(a->mask_uv_rect.ToString(), b->mask_uv_rect.ToString());
- EXPECT_EQ(a->filters, b->filters);
- if (!a->filter || !b->filter)
- EXPECT_EQ(a->filter, b->filter);
- else
- EXPECT_EQ(a->filter->countInputs(), b->filter->countInputs());
+ EXPECT_EQ(a->filters.size(), b->filters.size());
+ for (size_t i = 0; i < a->filters.size(); ++i) {
+ if (a->filters.at(i).type() != cc::FilterOperation::REFERENCE) {
+ EXPECT_EQ(a->filters.at(i), b->filters.at(i));
+ } else {
+ EXPECT_EQ(b->filters.at(i).type(), cc::FilterOperation::REFERENCE);
+ EXPECT_EQ(a->filters.at(i).image_filter()->countInputs(),
+ b->filters.at(i).image_filter()->countInputs());
+ }
+ }
EXPECT_EQ(a->background_filters, b->background_filters);
}
@@ -235,14 +240,15 @@ TEST_F(CCMessagesTest, AllQuads) {
FilterOperations arbitrary_filters1;
arbitrary_filters1.Append(FilterOperation::CreateGrayscaleFilter(
arbitrary_float1));
+ skia::RefPtr<SkImageFilter> arbitrary_filter = skia::AdoptRef(
+ new SkBlurImageFilter(arbitrary_sigma, arbitrary_sigma));
+ arbitrary_filters1.Append(
+ cc::FilterOperation::CreateReferenceFilter(arbitrary_filter));
FilterOperations arbitrary_filters2;
arbitrary_filters2.Append(FilterOperation::CreateBrightnessFilter(
arbitrary_float2));
- skia::RefPtr<SkImageFilter> arbitrary_filter = skia::AdoptRef(
- new SkBlurImageFilter(arbitrary_sigma, arbitrary_sigma));
-
scoped_ptr<SharedQuadState> shared_state1_in = SharedQuadState::Create();
shared_state1_in->SetAll(arbitrary_matrix,
arbitrary_size1,
@@ -301,7 +307,6 @@ TEST_F(CCMessagesTest, AllQuads) {
arbitrary_rect1,
arbitrary_rectf1,
arbitrary_filters1,
- arbitrary_filter,
arbitrary_filters2);
scoped_ptr<RenderPassDrawQuad> renderpass_cmp = renderpass_in->Copy(
renderpass_in->shared_quad_state, renderpass_in->render_pass_id);
« no previous file with comments | « content/common/cc_messages.cc ('k') | webkit/renderer/compositor_bindings/web_filter_operations_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698