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

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

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clip recorder params in omnibox. 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
« no previous file with comments | « cc/blink/web_display_item_list_impl.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 "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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
78 78
79 // Because Android WebView resourceless software draw mode rasters directly 79 // Because Android WebView resourceless software draw mode rasters directly
80 // to the root canvas, this draw must use the kSrcOver_Mode so that 80 // to the root canvas, this draw must use the kSrcOver_Mode so that
81 // transparent images blend correctly. 81 // transparent images blend correctly.
82 canvas->drawImage(image_.get(), 0, 0); 82 canvas->drawImage(image_.get(), 0, 0);
83 83
84 skia::RefPtr<SkPicture> picture = 84 skia::RefPtr<SkPicture> picture =
85 skia::AdoptRef(recorder.endRecordingAsPicture()); 85 skia::AdoptRef(recorder.endRecordingAsPicture());
86 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); 86 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip);
87 item->SetNew(std::move(picture)); 87 item->SetNew(std::move(picture));
88 88
89 display_list->Finalize(); 89 display_list->Finalize();
90 return display_list; 90 return display_list;
91 } 91 }
92 92
93 bool PictureImageLayer::FillsBoundsCompletely() const { 93 bool PictureImageLayer::FillsBoundsCompletely() const {
94 return false; 94 return false;
95 } 95 }
96 96
97 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 97 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
98 return 0; 98 return 0;
99 } 99 }
100 100
101 } // namespace cc 101 } // namespace cc
OLDNEW
« no previous file with comments | « cc/blink/web_display_item_list_impl.cc ('k') | cc/playback/clip_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698