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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/layers/picture_image_layer_impl.h" | 9 #include "cc/layers/picture_image_layer_impl.h" |
10 #include "cc/playback/display_item_list_settings.h" | 10 #include "cc/playback/display_item_list_settings.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width()); | 73 SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width()); |
74 SkScalar content_to_layer_scale_y = | 74 SkScalar content_to_layer_scale_y = |
75 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); | 75 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); |
76 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); | 76 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); |
77 | 77 |
78 // Because Android WebView resourceless software draw mode rasters directly | 78 // Because Android WebView resourceless software draw mode rasters directly |
79 // to the root canvas, this draw must use the kSrcOver_Mode so that | 79 // to the root canvas, this draw must use the kSrcOver_Mode so that |
80 // transparent images blend correctly. | 80 // transparent images blend correctly. |
81 canvas->drawImage(image_.get(), 0, 0); | 81 canvas->drawImage(image_.get(), 0, 0); |
82 | 82 |
83 skia::RefPtr<SkPicture> picture = | 83 display_list->CreateAndAppendItem<DrawingDisplayItem>( |
84 skia::AdoptRef(recorder.endRecordingAsPicture()); | 84 PaintableRegion(), recorder.finishRecordingAsPicture()); |
85 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(), | |
86 std::move(picture)); | |
87 | 85 |
88 display_list->Finalize(); | 86 display_list->Finalize(); |
89 return display_list; | 87 return display_list; |
90 } | 88 } |
91 | 89 |
92 bool PictureImageLayer::FillsBoundsCompletely() const { | 90 bool PictureImageLayer::FillsBoundsCompletely() const { |
93 return false; | 91 return false; |
94 } | 92 } |
95 | 93 |
96 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { | 94 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { |
97 return 0; | 95 return 0; |
98 } | 96 } |
99 | 97 |
100 } // namespace cc | 98 } // namespace cc |
OLD | NEW |