| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/layers/picture_image_layer.h" | 5 #include "cc/layers/picture_image_layer.h" |
| 6 | 6 |
| 7 #include "cc/layers/picture_image_layer_impl.h" | 7 #include "cc/layers/picture_image_layer_impl.h" |
| 8 #include "cc/playback/display_item_list_settings.h" | 8 #include "cc/playback/display_item_list_settings.h" |
| 9 #include "cc/playback/drawing_display_item.h" | 9 #include "cc/playback/drawing_display_item.h" |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); | 72 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); |
| 73 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); | 73 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); |
| 74 | 74 |
| 75 // Because Android WebView resourceless software draw mode rasters directly | 75 // Because Android WebView resourceless software draw mode rasters directly |
| 76 // to the root canvas, this draw must use the kSrcOver_Mode so that | 76 // to the root canvas, this draw must use the kSrcOver_Mode so that |
| 77 // transparent images blend correctly. | 77 // transparent images blend correctly. |
| 78 canvas->drawImage(image_.get(), 0, 0); | 78 canvas->drawImage(image_.get(), 0, 0); |
| 79 | 79 |
| 80 skia::RefPtr<SkPicture> picture = | 80 skia::RefPtr<SkPicture> picture = |
| 81 skia::AdoptRef(recorder.endRecordingAsPicture()); | 81 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 82 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); | 82 // TODO(wkorman): Make sure the rect is correct below. |
| 83 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip); |
| 83 item->SetNew(picture.Pass()); | 84 item->SetNew(picture.Pass()); |
| 84 | 85 |
| 85 display_list->Finalize(); | 86 display_list->Finalize(); |
| 86 return display_list; | 87 return display_list; |
| 87 } | 88 } |
| 88 | 89 |
| 89 bool PictureImageLayer::FillsBoundsCompletely() const { | 90 bool PictureImageLayer::FillsBoundsCompletely() const { |
| 90 return false; | 91 return false; |
| 91 } | 92 } |
| 92 | 93 |
| 93 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { | 94 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { |
| 94 return 0; | 95 return 0; |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace cc | 98 } // namespace cc |
| OLD | NEW |