| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PaintArtifactCompositor.h" | 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
| 6 | 6 |
| 7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
| 10 #include "cc/playback/display_item_list.h" | 10 #include "cc/playback/display_item_list.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (!picture) | 85 if (!picture) |
| 86 return; | 86 return; |
| 87 gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); | 87 gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); |
| 88 list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, sk_ref_sp(pict
ure)); | 88 list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, sk_ref_sp(pict
ure)); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 static scoped_refptr<cc::DisplayItemList> recordPaintChunk(const PaintArtifact&
artifact, const PaintChunk& chunk, const gfx::Rect& combinedBounds) | 92 static scoped_refptr<cc::DisplayItemList> recordPaintChunk(const PaintArtifact&
artifact, const PaintChunk& chunk, const gfx::Rect& combinedBounds) |
| 93 { | 93 { |
| 94 cc::DisplayItemListSettings settings; | 94 cc::DisplayItemListSettings settings; |
| 95 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create( | 95 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create(settin
gs); |
| 96 gfx::Rect(combinedBounds.size()), settings); | |
| 97 | 96 |
| 98 gfx::Transform translation; | 97 gfx::Transform translation; |
| 99 translation.Translate(-combinedBounds.x(), -combinedBounds.y()); | 98 translation.Translate(-combinedBounds.x(), -combinedBounds.y()); |
| 100 // TODO(jbroman, wkorman): What visual rectangle is wanted here? | 99 // TODO(jbroman, wkorman): What visual rectangle is wanted here? |
| 101 list->CreateAndAppendItem<cc::TransformDisplayItem>(gfx::Rect(), translation
); | 100 list->CreateAndAppendItem<cc::TransformDisplayItem>(gfx::Rect(), translation
); |
| 102 | 101 |
| 103 const DisplayItemList& displayItems = artifact.getDisplayItemList(); | 102 const DisplayItemList& displayItems = artifact.getDisplayItemList(); |
| 104 for (const auto& displayItem : displayItems.itemsInPaintChunk(chunk)) | 103 for (const auto& displayItem : displayItems.itemsInPaintChunk(chunk)) |
| 105 appendDisplayItemToCcDisplayItemList(displayItem, list.get()); | 104 appendDisplayItemToCcDisplayItemList(displayItem, list.get()); |
| 106 | 105 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 layer->SetEffectTreeIndex(kSecondaryRootNodeId); | 421 layer->SetEffectTreeIndex(kSecondaryRootNodeId); |
| 423 layer->SetScrollTreeIndex(kSecondaryRootNodeId); | 422 layer->SetScrollTreeIndex(kSecondaryRootNodeId); |
| 424 } | 423 } |
| 425 | 424 |
| 426 // Mark the property trees as having been rebuilt. | 425 // Mark the property trees as having been rebuilt. |
| 427 host->property_trees()->sequence_number = kPropertyTreeSequenceNumber; | 426 host->property_trees()->sequence_number = kPropertyTreeSequenceNumber; |
| 428 host->property_trees()->needs_rebuild = false; | 427 host->property_trees()->needs_rebuild = false; |
| 429 } | 428 } |
| 430 | 429 |
| 431 } // namespace blink | 430 } // namespace blink |
| OLD | NEW |