| 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/clip_display_item.h" | 12 #include "cc/paint/clip_display_item.h" |
| 13 #include "cc/paint/clip_path_display_item.h" | 13 #include "cc/paint/clip_path_display_item.h" |
| 14 #include "cc/paint/compositing_display_item.h" | 14 #include "cc/paint/compositing_display_item.h" |
| 15 #include "cc/paint/drawing_display_item.h" | 15 #include "cc/paint/drawing_display_item.h" |
| 16 #include "cc/paint/filter_display_item.h" | 16 #include "cc/paint/filter_display_item.h" |
| 17 #include "cc/paint/float_clip_display_item.h" | 17 #include "cc/paint/float_clip_display_item.h" |
| 18 #include "cc/paint/paint_record.h" | 18 #include "cc/paint/paint_record.h" |
| 19 #include "cc/paint/transform_display_item.h" | 19 #include "cc/paint/transform_display_item.h" |
| 20 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 20 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 21 #include "third_party/WebKit/public/platform/WebRect.h" | 21 #include "third_party/WebKit/public/platform/WebRect.h" |
| 22 #include "third_party/skia/include/core/SkColorFilter.h" | 22 #include "third_party/skia/include/core/SkColorFilter.h" |
| 23 #include "third_party/skia/include/core/SkMatrix44.h" | 23 #include "third_party/skia/include/core/SkMatrix44.h" |
| 24 #include "ui/gfx/geometry/rect_conversions.h" | 24 #include "ui/gfx/geometry/rect_conversions.h" |
| 25 #include "ui/gfx/geometry/safe_integer_conversions.h" | 25 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 26 #include "ui/gfx/skia_util.h" | |
| 27 #include "ui/gfx/transform.h" | 26 #include "ui/gfx/transform.h" |
| 28 | 27 |
| 29 namespace cc_blink { | 28 namespace cc_blink { |
| 30 | 29 |
| 31 namespace { | 30 namespace { |
| 32 | 31 |
| 33 } // namespace | 32 } // namespace |
| 34 | 33 |
| 35 WebDisplayItemListImpl::WebDisplayItemListImpl() | 34 WebDisplayItemListImpl::WebDisplayItemListImpl() |
| 36 : display_item_list_(new cc::DisplayItemList) {} | 35 : display_item_list_(new cc::DisplayItemList) {} |
| 37 | 36 |
| 38 WebDisplayItemListImpl::WebDisplayItemListImpl( | 37 WebDisplayItemListImpl::WebDisplayItemListImpl( |
| 39 cc::DisplayItemList* display_list) | 38 cc::DisplayItemList* display_list) |
| 40 : display_item_list_(display_list) { | 39 : display_item_list_(display_list) { |
| 41 } | 40 } |
| 42 | 41 |
| 43 void WebDisplayItemListImpl::AppendDrawingItem( | 42 void WebDisplayItemListImpl::AppendDrawingItem( |
| 44 const blink::WebRect& visual_rect, | 43 const blink::WebRect& visual_rect, |
| 45 sk_sp<const cc::PaintRecord> record, | 44 sk_sp<const cc::PaintRecord> record) { |
| 46 const blink::WebRect& record_bounds) { | |
| 47 display_item_list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( | 45 display_item_list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( |
| 48 visual_rect, std::move(record), gfx::RectToSkRect(record_bounds)); | 46 visual_rect, std::move(record)); |
| 49 } | 47 } |
| 50 | 48 |
| 51 void WebDisplayItemListImpl::AppendClipItem( | 49 void WebDisplayItemListImpl::AppendClipItem( |
| 52 const blink::WebRect& clip_rect, | 50 const blink::WebRect& clip_rect, |
| 53 const blink::WebVector<SkRRect>& rounded_clip_rects) { | 51 const blink::WebVector<SkRRect>& rounded_clip_rects) { |
| 54 std::vector<SkRRect> rounded_rects; | 52 std::vector<SkRRect> rounded_rects; |
| 55 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { | 53 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { |
| 56 rounded_rects.push_back(rounded_clip_rects[i]); | 54 rounded_rects.push_back(rounded_clip_rects[i]); |
| 57 } | 55 } |
| 58 bool antialias = true; | 56 bool antialias = true; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 147 } |
| 150 | 148 |
| 151 void WebDisplayItemListImpl::SetIsSuitableForGpuRasterization(bool isSuitable) { | 149 void WebDisplayItemListImpl::SetIsSuitableForGpuRasterization(bool isSuitable) { |
| 152 display_item_list_->SetIsSuitableForGpuRasterization(isSuitable); | 150 display_item_list_->SetIsSuitableForGpuRasterization(isSuitable); |
| 153 } | 151 } |
| 154 | 152 |
| 155 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 153 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
| 156 } | 154 } |
| 157 | 155 |
| 158 } // namespace cc_blink | 156 } // namespace cc_blink |
| OLD | NEW |