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

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

Issue 1819683002: Use sk_sp-based picture recording APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skspify GetPicture/GetFlattenedPicture Created 4 years, 9 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/layer_impl.cc ('k') | cc/layers/picture_layer.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
77 77
78 // Because Android WebView resourceless software draw mode rasters directly 78 // Because Android WebView resourceless software draw mode rasters directly
79 // to the root canvas, this draw must use the kSrcOver_Mode so that 79 // to the root canvas, this draw must use the kSrcOver_Mode so that
80 // transparent images blend correctly. 80 // transparent images blend correctly.
81 canvas->drawImage(image_.get(), 0, 0); 81 canvas->drawImage(image_.get(), 0, 0);
82 82
83 skia::RefPtr<SkPicture> picture = 83 display_list->CreateAndAppendItem<DrawingDisplayItem>(
84 skia::AdoptRef(recorder.endRecordingAsPicture()); 84 PaintableRegion(), recorder.finishRecordingAsPicture());
85 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(),
86 std::move(picture));
87 85
88 display_list->Finalize(); 86 display_list->Finalize();
89 return display_list; 87 return display_list;
90 } 88 }
91 89
92 bool PictureImageLayer::FillsBoundsCompletely() const { 90 bool PictureImageLayer::FillsBoundsCompletely() const {
93 return false; 91 return false;
94 } 92 }
95 93
96 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 94 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
97 return 0; 95 return 0;
98 } 96 }
99 97
100 } // namespace cc 98 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/picture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698