| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/playback/display_item_list.h" | 5 #include "cc/playback/display_item_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 gfx::Size layer_size(10, 10); | 183 gfx::Size layer_size(10, 10); |
| 184 | 184 |
| 185 DisplayItemListSettings settings; | 185 DisplayItemListSettings settings; |
| 186 scoped_refptr<DisplayItemList> list = | 186 scoped_refptr<DisplayItemList> list = |
| 187 DisplayItemList::Create(gfx::Rect(layer_size), settings); | 187 DisplayItemList::Create(gfx::Rect(layer_size), settings); |
| 188 | 188 |
| 189 // Build the DrawingDisplayItem. | 189 // Build the DrawingDisplayItem. |
| 190 AppendFirstSerializationTestPicture(list, layer_size); | 190 AppendFirstSerializationTestPicture(list, layer_size); |
| 191 | 191 |
| 192 // Build the CompositingDisplayItem. | 192 // Build the CompositingDisplayItem. |
| 193 skia::RefPtr<SkColorFilter> filter = skia::AdoptRef( | |
| 194 SkColorMatrixFilter::CreateLightingFilter(SK_ColorRED, SK_ColorGREEN)); | |
| 195 list->CreateAndAppendItem<CompositingDisplayItem>( | 193 list->CreateAndAppendItem<CompositingDisplayItem>( |
| 196 kVisualRect, 150, SkXfermode::Mode::kDst_Mode, nullptr, filter, false); | 194 kVisualRect, 150, SkXfermode::Mode::kDst_Mode, nullptr, |
| 195 SkColorMatrixFilter::MakeLightingFilter(SK_ColorRED, SK_ColorGREEN), |
| 196 false); |
| 197 | 197 |
| 198 // Build the second DrawingDisplayItem. | 198 // Build the second DrawingDisplayItem. |
| 199 AppendSecondSerializationTestPicture(list, layer_size); | 199 AppendSecondSerializationTestPicture(list, layer_size); |
| 200 | 200 |
| 201 // Build the EndCompositingDisplayItem. | 201 // Build the EndCompositingDisplayItem. |
| 202 list->CreateAndAppendItem<EndCompositingDisplayItem>(kVisualRect); | 202 list->CreateAndAppendItem<EndCompositingDisplayItem>(kVisualRect); |
| 203 | 203 |
| 204 ValidateDisplayItemListSerialization(layer_size, list); | 204 ValidateDisplayItemListSerialization(layer_size, list); |
| 205 } | 205 } |
| 206 | 206 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 | 753 |
| 754 value = list->AsValue(false)->ToString(); | 754 value = list->AsValue(false)->ToString(); |
| 755 EXPECT_EQ(value.find("\"items\":"), std::string::npos); | 755 EXPECT_EQ(value.find("\"items\":"), std::string::npos); |
| 756 EXPECT_NE(value.find("\"layer_rect\":[0,0,0,0]"), std::string::npos); | 756 EXPECT_NE(value.find("\"layer_rect\":[0,0,0,0]"), std::string::npos); |
| 757 // There should be no skp64 entry present as the items aren't included and the | 757 // There should be no skp64 entry present as the items aren't included and the |
| 758 // layer rect is empty. | 758 // layer rect is empty. |
| 759 EXPECT_EQ(value.find("\"skp64\":"), std::string::npos); | 759 EXPECT_EQ(value.find("\"skp64\":"), std::string::npos); |
| 760 } | 760 } |
| 761 | 761 |
| 762 } // namespace cc | 762 } // namespace cc |
| OLD | NEW |