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

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: rebase Created 7 years, 4 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/quads/draw_quad.h ('k') | cc/quads/io_surface_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/draw_quad.cc
diff --git a/cc/quads/draw_quad.cc b/cc/quads/draw_quad.cc
index 6c8d9b6654a18c75b202b1506d8919cf6c72ef3d..0d021d92083834db893366d5628937446af3ee34 100644
--- a/cc/quads/draw_quad.cc
+++ b/cc/quads/draw_quad.cc
@@ -5,6 +5,9 @@
#include "cc/quads/draw_quad.h"
#include "base/logging.h"
+#include "base/values.h"
+#include "cc/base/math_util.h"
+#include "cc/debug/traced_value.h"
#include "cc/quads/checkerboard_draw_quad.h"
#include "cc/quads/debug_border_draw_quad.h"
#include "cc/quads/io_surface_draw_quad.h"
@@ -15,6 +18,7 @@
#include "cc/quads/texture_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
#include "cc/quads/yuv_video_draw_quad.h"
+#include "ui/gfx/quad_f.h"
namespace {
template<typename T> T* TypedCopy(const cc::DrawQuad* other) {
@@ -90,4 +94,48 @@ 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("shared_state",
+ TracedValue::CreateIDRef(shared_quad_state).release());
+
+ value->Set("content_space_rect", MathUtil::AsValue(rect).release());
+ bool rect_is_clipped;
+ gfx::QuadF rect_as_target_space_quad = MathUtil::MapQuad(
+ shared_quad_state->content_to_target_transform,
+ gfx::QuadF(rect),
+ &rect_is_clipped);
+ value->Set("rect_as_target_space_quad",
+ MathUtil::AsValue(rect_as_target_space_quad).release());
+ value->SetBoolean("rect_is_clipped", rect_is_clipped);
+
+ value->Set("content_space_opaque_rect",
+ MathUtil::AsValue(opaque_rect).release());
+ bool opaque_rect_is_clipped;
+ gfx::QuadF opaque_rect_as_target_space_quad = MathUtil::MapQuad(
+ shared_quad_state->content_to_target_transform,
+ gfx::QuadF(opaque_rect),
+ &opaque_rect_is_clipped);
+ value->Set("opaque_rect_as_target_space_quad",
+ MathUtil::AsValue(opaque_rect_as_target_space_quad).release());
+ value->SetBoolean("opaque_rect_is_clipped", opaque_rect_is_clipped);
+
+ value->Set("content_space_visible_rect",
+ MathUtil::AsValue(visible_rect).release());
+ bool visible_rect_is_clipped;
+ gfx::QuadF visible_rect_as_target_space_quad = MathUtil::MapQuad(
+ shared_quad_state->content_to_target_transform,
+ gfx::QuadF(visible_rect),
+ &visible_rect_is_clipped);
+ value->Set("visible_rect_as_target_space_quad",
+ MathUtil::AsValue(visible_rect_as_target_space_quad).release());
+ value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped);
+
+ value->SetBoolean("needs_blending", needs_blending);
+ value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending());
+ ExtendValue(value.get());
+ return value.PassAs<base::Value>();
+}
+
} // namespace cc
« no previous file with comments | « cc/quads/draw_quad.h ('k') | cc/quads/io_surface_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698