| 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/base/render_surface_filters.h" | 7 #include "cc/base/render_surface_filters.h" |
| 8 #include "cc/paint/display_item_list.h" | 8 #include "cc/paint/display_item_list.h" |
| 9 #include "cc/paint/paint_op_buffer.h" | 9 #include "cc/paint/paint_op_buffer.h" |
| 10 #include "platform/graphics/GraphicsContext.h" | 10 #include "platform/graphics/GraphicsContext.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // TODO(danakj): This loop could use base::Reversed once it's allowed here. | 190 // TODO(danakj): This loop could use base::Reversed once it's allowed here. |
| 191 for (auto it = needed_restores.rbegin(); it != needed_restores.rend(); ++it) { | 191 for (auto it = needed_restores.rbegin(); it != needed_restores.rend(); ++it) { |
| 192 cc::PaintOpBuffer* buffer = cc_list.StartPaint(); | 192 cc::PaintOpBuffer* buffer = cc_list.StartPaint(); |
| 193 int num_restores = *it; | 193 int num_restores = *it; |
| 194 for (int i = 0; i < num_restores; ++i) | 194 for (int i = 0; i < num_restores; ++i) |
| 195 buffer->push<cc::RestoreOp>(); | 195 buffer->push<cc::RestoreOp>(); |
| 196 cc_list.EndPaintOfPairedEnd(); | 196 cc_list.EndPaintOfPairedEnd(); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 static gfx::Rect g_large_rect(-200000, -200000, 400000, 400000); | 200 constexpr gfx::Rect g_large_rect(-200000, -200000, 400000, 400000); |
| 201 static void AppendDisplayItemToCcDisplayItemList( | 201 static void AppendDisplayItemToCcDisplayItemList( |
| 202 const DisplayItem& display_item, | 202 const DisplayItem& display_item, |
| 203 cc::DisplayItemList& cc_list) { | 203 cc::DisplayItemList& cc_list) { |
| 204 DCHECK(DisplayItem::IsDrawingType(display_item.GetType())); | 204 DCHECK(DisplayItem::IsDrawingType(display_item.GetType())); |
| 205 if (DisplayItem::IsDrawingType(display_item.GetType())) { | 205 if (DisplayItem::IsDrawingType(display_item.GetType())) { |
| 206 const auto& drawing_display_item = | 206 const auto& drawing_display_item = |
| 207 static_cast<const DrawingDisplayItem&>(display_item); | 207 static_cast<const DrawingDisplayItem&>(display_item); |
| 208 sk_sp<const cc::PaintOpBuffer> record = | 208 sk_sp<const cc::PaintOpBuffer> record = |
| 209 drawing_display_item.GetPaintRecord(); | 209 drawing_display_item.GetPaintRecord(); |
| 210 if (!record) | 210 if (!record) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 buffer->push<cc::DrawRecordOp>(record); | 289 buffer->push<cc::DrawRecordOp>(record); |
| 290 cc_list->EndPaintOfUnpaired(g_large_rect); | 290 cc_list->EndPaintOfUnpaired(g_large_rect); |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 cc_list->Finalize(); | 294 cc_list->Finalize(); |
| 295 return cc_list; | 295 return cc_list; |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace blink | 298 } // namespace blink |
| OLD | NEW |