| 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" |
| 26 #include "ui/gfx/transform.h" | 27 #include "ui/gfx/transform.h" |
| 27 | 28 |
| 28 namespace cc_blink { | 29 namespace cc_blink { |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 32 } // namespace | 33 } // namespace |
| 33 | 34 |
| 34 WebDisplayItemListImpl::WebDisplayItemListImpl() | 35 WebDisplayItemListImpl::WebDisplayItemListImpl() |
| 35 : display_item_list_(new cc::DisplayItemList) {} | 36 : display_item_list_(new cc::DisplayItemList) {} |
| 36 | 37 |
| 37 WebDisplayItemListImpl::WebDisplayItemListImpl( | 38 WebDisplayItemListImpl::WebDisplayItemListImpl( |
| 38 cc::DisplayItemList* display_list) | 39 cc::DisplayItemList* display_list) |
| 39 : display_item_list_(display_list) { | 40 : display_item_list_(display_list) { |
| 40 } | 41 } |
| 41 | 42 |
| 42 void WebDisplayItemListImpl::AppendDrawingItem( | 43 void WebDisplayItemListImpl::AppendDrawingItem( |
| 43 const blink::WebRect& visual_rect, | 44 const blink::WebRect& visual_rect, |
| 44 sk_sp<const cc::PaintRecord> record) { | 45 sk_sp<const cc::PaintRecord> record, |
| 46 const blink::WebRect& record_bounds) { |
| 45 display_item_list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( | 47 display_item_list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( |
| 46 visual_rect, std::move(record)); | 48 visual_rect, std::move(record), gfx::RectToSkRect(record_bounds)); |
| 47 } | 49 } |
| 48 | 50 |
| 49 void WebDisplayItemListImpl::AppendClipItem( | 51 void WebDisplayItemListImpl::AppendClipItem( |
| 50 const blink::WebRect& clip_rect, | 52 const blink::WebRect& clip_rect, |
| 51 const blink::WebVector<SkRRect>& rounded_clip_rects) { | 53 const blink::WebVector<SkRRect>& rounded_clip_rects) { |
| 52 std::vector<SkRRect> rounded_rects; | 54 std::vector<SkRRect> rounded_rects; |
| 53 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { | 55 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { |
| 54 rounded_rects.push_back(rounded_clip_rects[i]); | 56 rounded_rects.push_back(rounded_clip_rects[i]); |
| 55 } | 57 } |
| 56 bool antialias = true; | 58 bool antialias = true; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 149 } |
| 148 | 150 |
| 149 void WebDisplayItemListImpl::SetIsSuitableForGpuRasterization(bool isSuitable) { | 151 void WebDisplayItemListImpl::SetIsSuitableForGpuRasterization(bool isSuitable) { |
| 150 display_item_list_->SetIsSuitableForGpuRasterization(isSuitable); | 152 display_item_list_->SetIsSuitableForGpuRasterization(isSuitable); |
| 151 } | 153 } |
| 152 | 154 |
| 153 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 155 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
| 154 } | 156 } |
| 155 | 157 |
| 156 } // namespace cc_blink | 158 } // namespace cc_blink |
| OLD | NEW |