| 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/blink/web_display_item_list_impl.h" | 5 #include "cc/blink/web_display_item_list_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "cc/paint/paint_record.h" |
| 12 #include "cc/playback/clip_display_item.h" | 13 #include "cc/playback/clip_display_item.h" |
| 13 #include "cc/playback/clip_path_display_item.h" | 14 #include "cc/playback/clip_path_display_item.h" |
| 14 #include "cc/playback/compositing_display_item.h" | 15 #include "cc/playback/compositing_display_item.h" |
| 15 #include "cc/playback/display_item_list_settings.h" | 16 #include "cc/playback/display_item_list_settings.h" |
| 16 #include "cc/playback/drawing_display_item.h" | 17 #include "cc/playback/drawing_display_item.h" |
| 17 #include "cc/playback/filter_display_item.h" | 18 #include "cc/playback/filter_display_item.h" |
| 18 #include "cc/playback/float_clip_display_item.h" | 19 #include "cc/playback/float_clip_display_item.h" |
| 19 #include "cc/playback/transform_display_item.h" | 20 #include "cc/playback/transform_display_item.h" |
| 20 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 21 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 21 #include "third_party/WebKit/public/platform/WebRect.h" | 22 #include "third_party/WebKit/public/platform/WebRect.h" |
| 22 #include "third_party/skia/include/core/SkColorFilter.h" | 23 #include "third_party/skia/include/core/SkColorFilter.h" |
| 23 #include "third_party/skia/include/core/SkMatrix44.h" | 24 #include "third_party/skia/include/core/SkMatrix44.h" |
| 24 #include "third_party/skia/include/core/SkPicture.h" | |
| 25 #include "ui/gfx/geometry/rect_conversions.h" | 25 #include "ui/gfx/geometry/rect_conversions.h" |
| 26 #include "ui/gfx/geometry/safe_integer_conversions.h" | 26 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 27 #include "ui/gfx/transform.h" | 27 #include "ui/gfx/transform.h" |
| 28 | 28 |
| 29 namespace cc_blink { | 29 namespace cc_blink { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 scoped_refptr<cc::DisplayItemList> CreateUncachedDisplayItemListForBlink() { | 33 scoped_refptr<cc::DisplayItemList> CreateUncachedDisplayItemListForBlink() { |
| 34 cc::DisplayItemListSettings settings; | 34 cc::DisplayItemListSettings settings; |
| 35 settings.use_cached_picture = false; | 35 settings.use_cached_picture = false; |
| 36 return cc::DisplayItemList::Create(settings); | 36 return cc::DisplayItemList::Create(settings); |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 WebDisplayItemListImpl::WebDisplayItemListImpl() | 41 WebDisplayItemListImpl::WebDisplayItemListImpl() |
| 42 : display_item_list_(CreateUncachedDisplayItemListForBlink()) { | 42 : display_item_list_(CreateUncachedDisplayItemListForBlink()) { |
| 43 } | 43 } |
| 44 | 44 |
| 45 WebDisplayItemListImpl::WebDisplayItemListImpl( | 45 WebDisplayItemListImpl::WebDisplayItemListImpl( |
| 46 cc::DisplayItemList* display_list) | 46 cc::DisplayItemList* display_list) |
| 47 : display_item_list_(display_list) { | 47 : display_item_list_(display_list) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 void WebDisplayItemListImpl::appendDrawingItem( | 50 void WebDisplayItemListImpl::appendDrawingItem( |
| 51 const blink::WebRect& visual_rect, | 51 const blink::WebRect& visual_rect, |
| 52 sk_sp<const SkPicture> picture) { | 52 sk_sp<const cc::PaintRecord> picture) { |
| 53 display_item_list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( | 53 display_item_list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( |
| 54 visual_rect, std::move(picture)); | 54 visual_rect, std::move(picture)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void WebDisplayItemListImpl::appendClipItem( | 57 void WebDisplayItemListImpl::appendClipItem( |
| 58 const blink::WebRect& clip_rect, | 58 const blink::WebRect& clip_rect, |
| 59 const blink::WebVector<SkRRect>& rounded_clip_rects) { | 59 const blink::WebVector<SkRRect>& rounded_clip_rects) { |
| 60 std::vector<SkRRect> rounded_rects; | 60 std::vector<SkRRect> rounded_rects; |
| 61 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { | 61 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { |
| 62 rounded_rects.push_back(rounded_clip_rects[i]); | 62 rounded_rects.push_back(rounded_clip_rects[i]); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 void WebDisplayItemListImpl::setImpliedColorSpace( | 162 void WebDisplayItemListImpl::setImpliedColorSpace( |
| 163 const gfx::ColorSpace& implied_color_space) { | 163 const gfx::ColorSpace& implied_color_space) { |
| 164 display_item_list_->SetImpliedColorSpace(implied_color_space); | 164 display_item_list_->SetImpliedColorSpace(implied_color_space); |
| 165 } | 165 } |
| 166 | 166 |
| 167 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 167 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace cc_blink | 170 } // namespace cc_blink |
| OLD | NEW |