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

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

Issue 1835843002: WIP: Fix foreignObject cullrect Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « cc/layers/empty_content_layer_client.cc ('k') | cc/playback/clip_display_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ContentLayerClient::PaintingControlSetting painting_control) { 56 ContentLayerClient::PaintingControlSetting painting_control) {
57 DCHECK(image_); 57 DCHECK(image_);
58 DCHECK_GT(image_->width(), 0); 58 DCHECK_GT(image_->width(), 0);
59 DCHECK_GT(image_->height(), 0); 59 DCHECK_GT(image_->height(), 0);
60 60
61 // Picture image layers can be used with GatherPixelRefs, so cached SkPictures 61 // Picture image layers can be used with GatherPixelRefs, so cached SkPictures
62 // are currently required. 62 // are currently required.
63 DisplayItemListSettings settings; 63 DisplayItemListSettings settings;
64 settings.use_cached_picture = true; 64 settings.use_cached_picture = true;
65 scoped_refptr<DisplayItemList> display_list = 65 scoped_refptr<DisplayItemList> display_list =
66 DisplayItemList::Create(PaintableRegion(), settings); 66 DisplayItemList::Create(settings);
67 67
68 SkPictureRecorder recorder; 68 SkPictureRecorder recorder;
69 SkCanvas* canvas = 69 SkCanvas* canvas =
70 recorder.beginRecording(gfx::RectToSkRect(PaintableRegion())); 70 recorder.beginRecording(gfx::RectToSkRect(PaintableRegion()));
71 71
72 SkScalar content_to_layer_scale_x = 72 SkScalar content_to_layer_scale_x =
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);
(...skipping 12 matching lines...) Expand all
89 89
90 bool PictureImageLayer::FillsBoundsCompletely() const { 90 bool PictureImageLayer::FillsBoundsCompletely() const {
91 return false; 91 return false;
92 } 92 }
93 93
94 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 94 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
95 return 0; 95 return 0;
96 } 96 }
97 97
98 } // namespace cc 98 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/empty_content_layer_client.cc ('k') | cc/playback/clip_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698