| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 ContentLayerClient::PaintingControlSetting painting_control) { | 57 ContentLayerClient::PaintingControlSetting painting_control) { |
| 58 DCHECK(image_); | 58 DCHECK(image_); |
| 59 DCHECK_GT(image_->width(), 0); | 59 DCHECK_GT(image_->width(), 0); |
| 60 DCHECK_GT(image_->height(), 0); | 60 DCHECK_GT(image_->height(), 0); |
| 61 DCHECK(layer_tree_host()); | 61 DCHECK(layer_tree_host()); |
| 62 | 62 |
| 63 DisplayItemListSettings settings; | 63 DisplayItemListSettings settings; |
| 64 settings.use_cached_picture = | 64 settings.use_cached_picture = |
| 65 layer_tree_host()->settings().use_cached_picture_raster; | 65 layer_tree_host()->settings().use_cached_picture_raster; |
| 66 scoped_refptr<DisplayItemList> display_list = | 66 scoped_refptr<DisplayItemList> display_list = |
| 67 DisplayItemList::Create(PaintableRegion(), settings); | 67 DisplayItemList::Create(settings); |
| 68 | 68 |
| 69 SkPictureRecorder recorder; | 69 SkPictureRecorder recorder; |
| 70 SkCanvas* canvas = | 70 SkCanvas* canvas = |
| 71 recorder.beginRecording(gfx::RectToSkRect(PaintableRegion())); | 71 recorder.beginRecording(gfx::RectToSkRect(PaintableRegion())); |
| 72 | 72 |
| 73 SkScalar content_to_layer_scale_x = | 73 SkScalar content_to_layer_scale_x = |
| 74 SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width()); | 74 SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width()); |
| 75 SkScalar content_to_layer_scale_y = | 75 SkScalar content_to_layer_scale_y = |
| 76 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); | 76 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); |
| 77 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); | 77 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 bool PictureImageLayer::FillsBoundsCompletely() const { | 91 bool PictureImageLayer::FillsBoundsCompletely() const { |
| 92 return false; | 92 return false; |
| 93 } | 93 } |
| 94 | 94 |
| 95 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { | 95 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { |
| 96 return 0; | 96 return 0; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace cc | 99 } // namespace cc |
| OLD | NEW |