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

Side by Side Diff: cc/test/solid_color_content_layer_client.cc

Issue 2509983004: Revert "Change call-sites now that SkCanvas is not ref-counted" (Closed)
Patch Set: Created 4 years, 1 month 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/test/fake_content_layer_client.cc ('k') | cc/trees/layer_tree_host_pixeltest_masks.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/solid_color_content_layer_client.h" 5 #include "cc/test/solid_color_content_layer_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/playback/display_item_list_settings.h" 9 #include "cc/playback/display_item_list_settings.h"
10 #include "cc/playback/drawing_display_item.h" 10 #include "cc/playback/drawing_display_item.h"
11 #include "third_party/skia/include/core/SkCanvas.h" 11 #include "third_party/skia/include/core/SkCanvas.h"
12 #include "third_party/skia/include/core/SkPaint.h" 12 #include "third_party/skia/include/core/SkPaint.h"
13 #include "third_party/skia/include/core/SkPictureRecorder.h" 13 #include "third_party/skia/include/core/SkPictureRecorder.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/rect_f.h" 15 #include "ui/gfx/geometry/rect_f.h"
16 #include "ui/gfx/skia_util.h" 16 #include "ui/gfx/skia_util.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 gfx::Rect SolidColorContentLayerClient::PaintableRegion() { 20 gfx::Rect SolidColorContentLayerClient::PaintableRegion() {
21 return gfx::Rect(size_); 21 return gfx::Rect(size_);
22 } 22 }
23 23
24 scoped_refptr<DisplayItemList> 24 scoped_refptr<DisplayItemList>
25 SolidColorContentLayerClient::PaintContentsToDisplayList( 25 SolidColorContentLayerClient::PaintContentsToDisplayList(
26 PaintingControlSetting painting_control) { 26 PaintingControlSetting painting_control) {
27 SkPictureRecorder recorder; 27 SkPictureRecorder recorder;
28 gfx::Rect clip(PaintableRegion()); 28 gfx::Rect clip(PaintableRegion());
29 SkCanvas* canvas = recorder.beginRecording(gfx::RectToSkRect(clip)); 29 sk_sp<SkCanvas> canvas =
30 sk_ref_sp(recorder.beginRecording(gfx::RectToSkRect(clip)));
30 31
31 canvas->clear(SK_ColorTRANSPARENT); 32 canvas->clear(SK_ColorTRANSPARENT);
32 33
33 if (border_size_ != 0) { 34 if (border_size_ != 0) {
34 SkPaint paint; 35 SkPaint paint;
35 paint.setStyle(SkPaint::kFill_Style); 36 paint.setStyle(SkPaint::kFill_Style);
36 paint.setColor(border_color_); 37 paint.setColor(border_color_);
37 canvas->drawRect( 38 canvas->drawRect(
38 SkRect::MakeXYWH(clip.x(), clip.y(), clip.width(), clip.height()), 39 SkRect::MakeXYWH(clip.x(), clip.y(), clip.width(), clip.height()),
39 paint); 40 paint);
(...skipping 22 matching lines...) Expand all
62 63
63 bool SolidColorContentLayerClient::FillsBoundsCompletely() const { 64 bool SolidColorContentLayerClient::FillsBoundsCompletely() const {
64 return false; 65 return false;
65 } 66 }
66 67
67 size_t SolidColorContentLayerClient::GetApproximateUnsharedMemoryUsage() const { 68 size_t SolidColorContentLayerClient::GetApproximateUnsharedMemoryUsage() const {
68 return 0; 69 return 0;
69 } 70 }
70 71
71 } // namespace cc 72 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_content_layer_client.cc ('k') | cc/trees/layer_tree_host_pixeltest_masks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698