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

Unified Diff: cc/quads/draw_quad.cc

Issue 20667002: cc: Add frame data to LTHI tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/quads/draw_quad.cc
diff --git a/cc/quads/draw_quad.cc b/cc/quads/draw_quad.cc
index 6c8d9b6654a18c75b202b1506d8919cf6c72ef3d..69706a090c28adc4fcfd245edda3ec29b057d07c 100644
--- a/cc/quads/draw_quad.cc
+++ b/cc/quads/draw_quad.cc
@@ -5,6 +5,8 @@
#include "cc/quads/draw_quad.h"
#include "base/logging.h"
+#include "base/values.h"
+#include "cc/base/math_util.h"
#include "cc/quads/checkerboard_draw_quad.h"
#include "cc/quads/debug_border_draw_quad.h"
#include "cc/quads/io_surface_draw_quad.h"
@@ -90,4 +92,26 @@ scoped_ptr<DrawQuad> DrawQuad::Copy(
return copy_quad.Pass();
}
+scoped_ptr<base::Value> DrawQuad::AsValue() const {
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ value->SetInteger("material", material);
+ value->Set("transform", MathUtil::AsValue(
+ shared_quad_state->content_to_target_transform).release());
+ value->Set("rect", MathUtil::AsValue(rect).release());
vmpstr 2013/07/26 16:07:23 Maybe the rects can be named something like "conte
danakj 2013/07/26 16:49:08 Agree, content_rect is our typical nomenclature fo
piman 2013/07/31 00:36:43 Following our discussion, and the need to have a p
+ value->Set("opaque_rect", MathUtil::AsValue(opaque_rect).release());
+ value->Set("visible_rect", MathUtil::AsValue(visible_rect).release());
+ value->Set("layer_content_bounds", MathUtil::AsValue(
+ shared_quad_state->visible_content_rect).release());
+ value->Set("layer_visible_content_rect", MathUtil::AsValue(
+ shared_quad_state->visible_content_rect).release());
+ value->SetBoolean("is_clipped", shared_quad_state->is_clipped);
+ value->Set("clip_rect",
+ MathUtil::AsValue(shared_quad_state->clip_rect).release());
+ value->SetBoolean("needs_blending", needs_blending);
+ value->SetDouble("opacity", shared_quad_state->opacity);
+ value->SetBoolean("ShouldDrawWithBlending()", ShouldDrawWithBlending());
vmpstr 2013/07/26 16:07:23 should_draw_with_blending
piman 2013/07/31 00:36:43 Done.
+ ExtendValue(value.get());
+ return value.PassAs<base::Value>();
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698