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

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: Fix up ClipDisplayItem 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..d4e0b859c7d4b8bf70deab4858af170bdc494472 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,32 @@ 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 (SkRRect rounded_rect : rounded_clip_rects_) {
danakj 2015/02/02 23:31:11 SkRRect&? or const SkRRect&? or const auto&?
ajuma 2015/02/02 23:35:09 Changed to const SkRRect&.
+ base::StringAppendF(
+ &value, " rounded_rect: [rect: [%s]",
+ gfx::SkRectToRectF(rounded_rect.rect()).ToString().c_str());
+ base::StringAppendF(&value, " radii: [");
+ SkVector upper_left_radius = rounded_rect.radii(SkRRect::kUpperLeft_Corner);
+ base::StringAppendF(&value, "[%f,%f],", upper_left_radius.x(),
+ upper_left_radius.y());
+ SkVector upper_right_radius =
+ rounded_rect.radii(SkRRect::kUpperRight_Corner);
+ base::StringAppendF(&value, " [%f,%f],", upper_right_radius.x(),
+ upper_right_radius.y());
+ SkVector lower_right_radius =
+ rounded_rect.radii(SkRRect::kLowerRight_Corner);
+ base::StringAppendF(&value, " [%f,%f],", lower_right_radius.x(),
+ lower_right_radius.y());
+ SkVector lower_left_radius = rounded_rect.radii(SkRRect::kLowerLeft_Corner);
+ base::StringAppendF(&value, " [%f,%f]]", lower_left_radius.x(),
+ lower_left_radius.y());
+ }
+ array->AppendString(value);
+}
+
EndClipDisplayItem::EndClipDisplayItem() {
}
@@ -71,4 +102,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