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/paint/drawing_display_item.h" | 10 #include "cc/paint/drawing_display_item.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 SkScalar content_to_layer_scale_y = SkFloatToScalar( | 71 SkScalar content_to_layer_scale_y = SkFloatToScalar( |
72 static_cast<float>(bounds().height()) / image_.sk_image()->height()); | 72 static_cast<float>(bounds().height()) / image_.sk_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_, 0, 0); | 78 canvas->drawImage(image_, 0, 0); |
79 | 79 |
80 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | 80 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( |
81 PaintableRegion(), recorder.finishRecordingAsPicture(), | 81 PaintableRegion(), recorder.finishRecordingAsPicture()); |
82 gfx::RectToSkRect(PaintableRegion())); | |
83 | 82 |
84 display_list->Finalize(); | 83 display_list->Finalize(); |
85 return display_list; | 84 return display_list; |
86 } | 85 } |
87 | 86 |
88 bool PictureImageLayer::FillsBoundsCompletely() const { | 87 bool PictureImageLayer::FillsBoundsCompletely() const { |
89 return false; | 88 return false; |
90 } | 89 } |
91 | 90 |
92 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { | 91 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { |
93 return 0; | 92 return 0; |
94 } | 93 } |
95 | 94 |
96 } // namespace cc | 95 } // namespace cc |
OLD | NEW |