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

Unified Diff: cc/resources/clip_display_item.cc

Issue 884473005: cc: Add trace output for individual DisplayItems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/clip_display_item.cc
diff --git a/cc/resources/clip_display_item.cc b/cc/resources/clip_display_item.cc
index 731c6059122df0930ce340ad894ad464a5242175..ec5ce94e9c30f3cf36ba7b205bc35ff154d5548d 100644
--- a/cc/resources/clip_display_item.cc
+++ b/cc/resources/clip_display_item.cc
@@ -4,7 +4,12 @@
#include "cc/resources/clip_display_item.h"
+#include <string>
+
+#include "base/strings/stringprintf.h"
+#include "base/trace_event/trace_event_argument.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/gfx/skia_util.h"
namespace cc {
@@ -48,6 +53,34 @@ size_t ClipDisplayItem::PictureMemoryUsage() const {
return total_size;
}
+void ClipDisplayItem::AsValueInto(base::debug::TracedValue* array) const {
+ std::string value = base::StringPrintf("ClipDisplayItem rect: [%s]",
+ clip_rect_.ToString().c_str());
+ for (size_t i = 0; i < rounded_clip_rects_.size(); ++i) {
pdr. 2015/02/02 22:22:16 You can use a fancy c++11 iterator here to clean u
ajuma 2015/02/02 23:02:21 Done.
+ base::StringAppendF(
+ &value, " rounded_rect: [rect: [%s]",
+ gfx::SkRectToRectF(rounded_clip_rects_[i].rect()).ToString().c_str());
+ base::StringAppendF(&value, " radii: [");
+ SkVector upper_left_radius =
+ rounded_clip_rects_[i].radii(SkRRect::kUpperLeft_Corner);
+ base::StringAppendF(&value, "[%f %f]", upper_left_radius.x(),
pdr. 2015/02/02 22:22:16 Can you double-check that the output of these is v
ajuma 2015/02/02 23:02:21 Added commas. The overall output for the list is
+ upper_left_radius.y());
+ SkVector upper_right_radius =
+ rounded_clip_rects_[i].radii(SkRRect::kUpperRight_Corner);
+ base::StringAppendF(&value, " [%f %f]", upper_right_radius.x(),
+ upper_right_radius.y());
+ SkVector lower_right_radius =
+ rounded_clip_rects_[i].radii(SkRRect::kLowerRight_Corner);
+ base::StringAppendF(&value, " [%f %f]", lower_right_radius.x(),
+ lower_right_radius.y());
+ SkVector lower_left_radius =
+ rounded_clip_rects_[i].radii(SkRRect::kLowerLeft_Corner);
+ base::StringAppendF(&value, " [%f %f]]", lower_left_radius.x(),
+ lower_left_radius.y());
+ }
+ array->AppendString(value);
+}
+
EndClipDisplayItem::EndClipDisplayItem() {
}
@@ -71,4 +104,8 @@ size_t EndClipDisplayItem::PictureMemoryUsage() const {
return 0;
}
+void EndClipDisplayItem::AsValueInto(base::debug::TracedValue* array) const {
+ array->AppendString("EndClipDisplayItem");
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698