| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 namespace { | 78 namespace { |
| 79 | 79 |
| 80 static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem,
cc::DisplayItemList* list) | 80 static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem,
cc::DisplayItemList* list) |
| 81 { | 81 { |
| 82 if (DisplayItem::isDrawingType(displayItem.getType())) { | 82 if (DisplayItem::isDrawingType(displayItem.getType())) { |
| 83 const SkPicture* picture = static_cast<const DrawingDisplayItem&>(displa
yItem).picture(); | 83 const SkPicture* picture = static_cast<const DrawingDisplayItem&>(displa
yItem).picture(); |
| 84 if (!picture) | 84 if (!picture) |
| 85 return; | 85 return; |
| 86 gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); | 86 gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); |
| 87 list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, skia::SharePtr
(picture)); | 87 list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, sk_ref_sp(pict
ure)); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 static scoped_refptr<cc::DisplayItemList> recordPaintChunk(const PaintArtifact&
artifact, const PaintChunk& chunk, const gfx::Rect& combinedBounds) | 91 static scoped_refptr<cc::DisplayItemList> recordPaintChunk(const PaintArtifact&
artifact, const PaintChunk& chunk, const gfx::Rect& combinedBounds) |
| 92 { | 92 { |
| 93 cc::DisplayItemListSettings settings; | 93 cc::DisplayItemListSettings settings; |
| 94 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create( | 94 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create( |
| 95 gfx::Rect(combinedBounds.size()), settings); | 95 gfx::Rect(combinedBounds.size()), settings); |
| 96 | 96 |
| 97 gfx::Transform translation; | 97 gfx::Transform translation; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 layer->SetIsDrawable(true); | 311 layer->SetIsDrawable(true); |
| 312 layer->SetDoubleSided(!paintChunk.properties.backfaceHidden); | 312 layer->SetDoubleSided(!paintChunk.properties.backfaceHidden); |
| 313 if (paintChunk.knownToBeOpaque) | 313 if (paintChunk.knownToBeOpaque) |
| 314 layer->SetContentsOpaque(true); | 314 layer->SetContentsOpaque(true); |
| 315 m_contentLayerClients.append(contentLayerClient.release()); | 315 m_contentLayerClients.append(contentLayerClient.release()); |
| 316 return layer; | 316 return layer; |
| 317 } | 317 } |
| 318 | 318 |
| 319 | 319 |
| 320 } // namespace blink | 320 } // namespace blink |
| OLD | NEW |