Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: cc/layers/picture_image_layer.cc

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 61
62 // Picture image layers can be used with GatherPixelRefs, so cached SkPictures 62 // Picture image layers can be used with GatherPixelRefs, so cached SkPictures
63 // are currently required. 63 // are currently required.
64 DisplayItemListSettings settings; 64 DisplayItemListSettings settings;
65 settings.use_cached_picture = true; 65 settings.use_cached_picture = true;
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 15 matching lines...) Expand all
93 93
94 bool PictureImageLayer::FillsBoundsCompletely() const { 94 bool PictureImageLayer::FillsBoundsCompletely() const {
95 return false; 95 return false;
96 } 96 }
97 97
98 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 98 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
99 return 0; 99 return 0;
100 } 100 }
101 101
102 } // namespace cc 102 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698