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

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

Issue 1494223003: cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make ui compile too oops 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 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 = 86 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(),
87 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion()); 87 std::move(picture));
88 item->SetNew(std::move(picture));
89 88
90 display_list->Finalize(); 89 display_list->Finalize();
91 return display_list; 90 return display_list;
92 } 91 }
93 92
94 bool PictureImageLayer::FillsBoundsCompletely() const { 93 bool PictureImageLayer::FillsBoundsCompletely() const {
95 return false; 94 return false;
96 } 95 }
97 96
98 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 97 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
99 return 0; 98 return 0;
100 } 99 }
101 100
102 } // namespace cc 101 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698