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

Side by Side Diff: cc/playback/clip_display_item.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/playback/clip_display_item.h ('k') | cc/playback/clip_path_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/clip_display_item.h" 5 #include "cc/playback/clip_display_item.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (rounded_clip_rects_[i].isRect()) { 69 if (rounded_clip_rects_[i].isRect()) {
70 canvas->clipRect(rounded_clip_rects_[i].rect()); 70 canvas->clipRect(rounded_clip_rects_[i].rect());
71 } else { 71 } else {
72 bool antialiased = true; 72 bool antialiased = true;
73 canvas->clipRRect(rounded_clip_rects_[i], SkRegion::kIntersect_Op, 73 canvas->clipRRect(rounded_clip_rects_[i], SkRegion::kIntersect_Op,
74 antialiased); 74 antialiased);
75 } 75 }
76 } 76 }
77 } 77 }
78 78
79 void ClipDisplayItem::AsValueInto(base::trace_event::TracedValue* array) const { 79 void ClipDisplayItem::AsValueInto(const gfx::Rect& visual_rect,
80 std::string value = base::StringPrintf("ClipDisplayItem rect: [%s]", 80 base::trace_event::TracedValue* array) const {
81 clip_rect_.ToString().c_str()); 81 std::string value = base::StringPrintf(
82 "ClipDisplayItem rect: [%s] visualRect: [%s]",
83 clip_rect_.ToString().c_str(), visual_rect.ToString().c_str());
82 for (const SkRRect& rounded_rect : rounded_clip_rects_) { 84 for (const SkRRect& rounded_rect : rounded_clip_rects_) {
83 base::StringAppendF( 85 base::StringAppendF(
84 &value, " rounded_rect: [rect: [%s]", 86 &value, " rounded_rect: [rect: [%s]",
85 gfx::SkRectToRectF(rounded_rect.rect()).ToString().c_str()); 87 gfx::SkRectToRectF(rounded_rect.rect()).ToString().c_str());
86 base::StringAppendF(&value, " radii: ["); 88 base::StringAppendF(&value, " radii: [");
87 SkVector upper_left_radius = rounded_rect.radii(SkRRect::kUpperLeft_Corner); 89 SkVector upper_left_radius = rounded_rect.radii(SkRRect::kUpperLeft_Corner);
88 base::StringAppendF(&value, "[%f,%f],", upper_left_radius.x(), 90 base::StringAppendF(&value, "[%f,%f],", upper_left_radius.x(),
89 upper_left_radius.y()); 91 upper_left_radius.y());
90 SkVector upper_right_radius = 92 SkVector upper_right_radius =
91 rounded_rect.radii(SkRRect::kUpperRight_Corner); 93 rounded_rect.radii(SkRRect::kUpperRight_Corner);
(...skipping 26 matching lines...) Expand all
118 DCHECK_EQ(proto::DisplayItem::Type_EndClip, proto.type()); 120 DCHECK_EQ(proto::DisplayItem::Type_EndClip, proto.type());
119 } 121 }
120 122
121 void EndClipDisplayItem::Raster(SkCanvas* canvas, 123 void EndClipDisplayItem::Raster(SkCanvas* canvas,
122 const gfx::Rect& canvas_target_playback_rect, 124 const gfx::Rect& canvas_target_playback_rect,
123 SkPicture::AbortCallback* callback) const { 125 SkPicture::AbortCallback* callback) const {
124 canvas->restore(); 126 canvas->restore();
125 } 127 }
126 128
127 void EndClipDisplayItem::AsValueInto( 129 void EndClipDisplayItem::AsValueInto(
130 const gfx::Rect& visual_rect,
128 base::trace_event::TracedValue* array) const { 131 base::trace_event::TracedValue* array) const {
129 array->AppendString("EndClipDisplayItem"); 132 array->AppendString(base::StringPrintf("EndClipDisplayItem visualRect: [%s]",
133 visual_rect.ToString().c_str()));
130 } 134 }
131 135
132 } // namespace cc 136 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/clip_display_item.h ('k') | cc/playback/clip_path_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698