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