OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 IntSize size = ExpandedIntSize(layer->Size()); | 371 IntSize size = ExpandedIntSize(layer->Size()); |
372 | 372 |
373 IntRect interest_rect(IntPoint(0, 0), size); | 373 IntRect interest_rect(IntPoint(0, 0), size); |
374 suppress_layer_paint_events_ = true; | 374 suppress_layer_paint_events_ = true; |
375 layer->Paint(&interest_rect); | 375 layer->Paint(&interest_rect); |
376 suppress_layer_paint_events_ = false; | 376 suppress_layer_paint_events_ = false; |
377 | 377 |
378 GraphicsContext context(layer->GetPaintController()); | 378 GraphicsContext context(layer->GetPaintController()); |
379 context.BeginRecording(interest_rect); | 379 context.BeginRecording(interest_rect); |
380 layer->GetPaintController().GetPaintArtifact().Replay(interest_rect, context); | 380 layer->GetPaintController().GetPaintArtifact().Replay(interest_rect, context); |
381 RefPtr<PictureSnapshot> snapshot = | 381 RefPtr<PictureSnapshot> snapshot = AdoptRef( |
382 AdoptRef(new PictureSnapshot(ToSkPicture(context.EndRecording()))); | 382 new PictureSnapshot(ToSkPicture(context.EndRecording(), interest_rect))); |
383 | 383 |
384 *snapshot_id = String::Number(++last_snapshot_id_); | 384 *snapshot_id = String::Number(++last_snapshot_id_); |
385 bool new_entry = snapshot_by_id_.insert(*snapshot_id, snapshot).is_new_entry; | 385 bool new_entry = snapshot_by_id_.insert(*snapshot_id, snapshot).is_new_entry; |
386 DCHECK(new_entry); | 386 DCHECK(new_entry); |
387 return Response::OK(); | 387 return Response::OK(); |
388 } | 388 } |
389 | 389 |
390 Response InspectorLayerTreeAgent::loadSnapshot( | 390 Response InspectorLayerTreeAgent::loadSnapshot( |
391 std::unique_ptr<Array<protocol::LayerTree::PictureTile>> tiles, | 391 std::unique_ptr<Array<protocol::LayerTree::PictureTile>> tiles, |
392 String* snapshot_id) { | 392 String* snapshot_id) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 506 } |
507 | 507 |
508 void InspectorLayerTreeAgent::DidRemovePageOverlay(const GraphicsLayer* layer) { | 508 void InspectorLayerTreeAgent::DidRemovePageOverlay(const GraphicsLayer* layer) { |
509 size_t index = page_overlay_layer_ids_.Find(layer->PlatformLayer()->Id()); | 509 size_t index = page_overlay_layer_ids_.Find(layer->PlatformLayer()->Id()); |
510 if (index == WTF::kNotFound) | 510 if (index == WTF::kNotFound) |
511 return; | 511 return; |
512 page_overlay_layer_ids_.erase(index); | 512 page_overlay_layer_ids_.erase(index); |
513 } | 513 } |
514 | 514 |
515 } // namespace blink | 515 } // namespace blink |
OLD | NEW |