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

Unified Diff: cc/resources/clip_display_item.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.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
« no previous file with comments | « cc/resources/clip_display_item.h ('k') | cc/resources/clip_path_display_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5a34dac9ed4c7b74108fd9b8097f1da845672813 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 (const SkRRect& rounded_rect : rounded_clip_rects_) {
+ 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
« no previous file with comments | « cc/resources/clip_display_item.h ('k') | cc/resources/clip_path_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698