OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "platform/graphics/compositing/PaintChunksToCcLayer.h" | 5 #include "platform/graphics/compositing/PaintChunksToCcLayer.h" |
6 | 6 |
7 #include "cc/playback/compositing_display_item.h" | 7 #include "cc/playback/compositing_display_item.h" |
8 #include "cc/playback/display_item_list.h" | 8 #include "cc/playback/display_item_list.h" |
9 #include "cc/playback/drawing_display_item.h" | 9 #include "cc/playback/drawing_display_item.h" |
10 #include "cc/playback/filter_display_item.h" | 10 #include "cc/playback/filter_display_item.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 ccList->CreateAndAppendPairedEndItem<cc::EndCompositingDisplayItem>(); | 175 ccList->CreateAndAppendPairedEndItem<cc::EndCompositingDisplayItem>(); |
176 break; | 176 break; |
177 } | 177 } |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 static gfx::Rect largeRect(-200000, -200000, 400000, 400000); | 181 static gfx::Rect largeRect(-200000, -200000, 400000, 400000); |
182 static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem, | 182 static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem, |
183 cc::DisplayItemList* list) { | 183 cc::DisplayItemList* list) { |
184 if (DisplayItem::isDrawingType(displayItem.getType())) { | 184 if (DisplayItem::isDrawingType(displayItem.getType())) { |
185 const PaintRecord* record = | 185 sk_sp<const PaintRecord> record = |
186 static_cast<const DrawingDisplayItem&>(displayItem).GetPaintRecord(); | 186 static_cast<const DrawingDisplayItem&>(displayItem).GetPaintRecord(); |
187 if (!record) | 187 if (!record) |
188 return; | 188 return; |
189 // In theory we would pass the bounds of the record, previously done as: | 189 // In theory we would pass the bounds of the record, previously done as: |
190 // gfx::Rect bounds = gfx::SkIRectToRect(record->cullRect().roundOut()); | 190 // gfx::Rect bounds = gfx::SkIRectToRect(record->cullRect().roundOut()); |
191 // or use the visual rect directly. However, clip content layers attempt | 191 // or use the visual rect directly. However, clip content layers attempt |
192 // to raster in a different space than that of the visual rects. We'll be | 192 // to raster in a different space than that of the visual rects. We'll be |
193 // reworking visual rects further for SPv2, so for now we just pass a | 193 // reworking visual rects further for SPv2, so for now we just pass a |
194 // visual rect large enough to make sure items raster. | 194 // visual rect large enough to make sure items raster. |
195 list->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>(largeRect, | 195 list->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>(largeRect, record); |
danakj
2017/03/16 20:06:16
move()
| |
196 sk_ref_sp(record)); | |
197 } | 196 } |
198 } | 197 } |
199 | 198 |
200 } // unnamed namespace | 199 } // unnamed namespace |
201 | 200 |
202 scoped_refptr<cc::DisplayItemList> PaintChunksToCcLayer::convert( | 201 scoped_refptr<cc::DisplayItemList> PaintChunksToCcLayer::convert( |
203 const Vector<const PaintChunk*>& paintChunks, | 202 const Vector<const PaintChunk*>& paintChunks, |
204 const PropertyTreeState& layerState, | 203 const PropertyTreeState& layerState, |
205 const gfx::Vector2dF& layerOffset, | 204 const gfx::Vector2dF& layerOffset, |
206 const DisplayItemList& displayItems, | 205 const DisplayItemList& displayItems, |
(...skipping 28 matching lines...) Expand all Loading... | |
235 recordPairedEndDisplayItems(endDisplayItems, ccList.get()); | 234 recordPairedEndDisplayItems(endDisplayItems, ccList.get()); |
236 } | 235 } |
237 | 236 |
238 ccList->CreateAndAppendPairedEndItem<cc::EndTransformDisplayItem>(); | 237 ccList->CreateAndAppendPairedEndItem<cc::EndTransformDisplayItem>(); |
239 | 238 |
240 ccList->Finalize(); | 239 ccList->Finalize(); |
241 return ccList; | 240 return ccList; |
242 } | 241 } |
243 | 242 |
244 } // namespace blink | 243 } // namespace blink |
OLD | NEW |