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

Side by Side Diff: cc/playback/float_clip_display_item.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 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/playback/float_clip_display_item.h ('k') | cc/playback/image_hijack_canvas.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/playback/float_clip_display_item.h" 5 #include "cc/playback/float_clip_display_item.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 24 matching lines...) Expand all
35 clip_rect_ = clip_rect; 35 clip_rect_ = clip_rect;
36 } 36 }
37 37
38 void FloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { 38 void FloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const {
39 proto->set_type(proto::DisplayItem::Type_FloatClip); 39 proto->set_type(proto::DisplayItem::Type_FloatClip);
40 40
41 proto::FloatClipDisplayItem* details = proto->mutable_float_clip_item(); 41 proto::FloatClipDisplayItem* details = proto->mutable_float_clip_item();
42 RectFToProto(clip_rect_, details->mutable_clip_rect()); 42 RectFToProto(clip_rect_, details->mutable_clip_rect());
43 } 43 }
44 44
45 void FloatClipDisplayItem::Raster(SkCanvas* canvas, 45 void FloatClipDisplayItem::Raster(CdlCanvas* canvas,
46 SkPicture::AbortCallback* callback) const { 46 SkPicture::AbortCallback* callback) const {
47 canvas->save(); 47 canvas->save();
48 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); 48 canvas->clipRect(gfx::RectFToSkRect(clip_rect_));
49 } 49 }
50 50
51 void FloatClipDisplayItem::AsValueInto( 51 void FloatClipDisplayItem::AsValueInto(
52 const gfx::Rect& visual_rect, 52 const gfx::Rect& visual_rect,
53 base::trace_event::TracedValue* array) const { 53 base::trace_event::TracedValue* array) const {
54 array->AppendString(base::StringPrintf( 54 array->AppendString(base::StringPrintf(
55 "FloatClipDisplayItem rect: [%s] visualRect: [%s]", 55 "FloatClipDisplayItem rect: [%s] visualRect: [%s]",
(...skipping 11 matching lines...) Expand all
67 DCHECK_EQ(proto::DisplayItem::Type_EndFloatClip, proto.type()); 67 DCHECK_EQ(proto::DisplayItem::Type_EndFloatClip, proto.type());
68 } 68 }
69 69
70 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { 70 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() {
71 } 71 }
72 72
73 void EndFloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { 73 void EndFloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const {
74 proto->set_type(proto::DisplayItem::Type_EndFloatClip); 74 proto->set_type(proto::DisplayItem::Type_EndFloatClip);
75 } 75 }
76 76
77 void EndFloatClipDisplayItem::Raster( 77 void EndFloatClipDisplayItem::Raster(CdlCanvas* canvas,
78 SkCanvas* canvas, 78 SkPicture::AbortCallback* callback) const {
79 SkPicture::AbortCallback* callback) const {
80 canvas->restore(); 79 canvas->restore();
81 } 80 }
82 81
83 void EndFloatClipDisplayItem::AsValueInto( 82 void EndFloatClipDisplayItem::AsValueInto(
84 const gfx::Rect& visual_rect, 83 const gfx::Rect& visual_rect,
85 base::trace_event::TracedValue* array) const { 84 base::trace_event::TracedValue* array) const {
86 array->AppendString( 85 array->AppendString(
87 base::StringPrintf("EndFloatClipDisplayItem visualRect: [%s]", 86 base::StringPrintf("EndFloatClipDisplayItem visualRect: [%s]",
88 visual_rect.ToString().c_str())); 87 visual_rect.ToString().c_str()));
89 } 88 }
90 89
91 size_t EndFloatClipDisplayItem::ExternalMemoryUsage() const { 90 size_t EndFloatClipDisplayItem::ExternalMemoryUsage() const {
92 return 0; 91 return 0;
93 } 92 }
94 93
95 } // namespace cc 94 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/float_clip_display_item.h ('k') | cc/playback/image_hijack_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698