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

Unified Diff: cc/quads/shared_quad_state.cc

Issue 1531403002: Revert "Delete CC." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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/shared_quad_state.h ('k') | cc/quads/solid_color_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/shared_quad_state.cc
diff --git a/cc/quads/shared_quad_state.cc b/cc/quads/shared_quad_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5e46fcc24d706f8f9f66a399a10eeeb46df85b28
--- /dev/null
+++ b/cc/quads/shared_quad_state.cc
@@ -0,0 +1,68 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/quads/shared_quad_state.h"
+
+#include "base/trace_event/trace_event_argument.h"
+#include "base/values.h"
+#include "cc/base/math_util.h"
+#include "cc/debug/traced_value.h"
+
+namespace cc {
+
+SharedQuadState::SharedQuadState()
+ : is_clipped(false),
+ opacity(0.f),
+ blend_mode(SkXfermode::kSrcOver_Mode),
+ sorting_context_id(0) {
+}
+
+SharedQuadState::~SharedQuadState() {
+ TRACE_EVENT_OBJECT_DELETED_WITH_ID(
+ TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"),
+ "cc::SharedQuadState", this);
+}
+
+void SharedQuadState::CopyFrom(const SharedQuadState* other) {
+ *this = *other;
+}
+
+void SharedQuadState::SetAll(const gfx::Transform& content_to_target_transform,
+ const gfx::Size& content_bounds,
+ const gfx::Rect& visible_content_rect,
+ const gfx::Rect& clip_rect,
+ bool is_clipped,
+ float opacity,
+ SkXfermode::Mode blend_mode,
+ int sorting_context_id) {
+ this->content_to_target_transform = content_to_target_transform;
+ this->content_bounds = content_bounds;
+ this->visible_content_rect = visible_content_rect;
+ this->clip_rect = clip_rect;
+ this->is_clipped = is_clipped;
+ this->opacity = opacity;
+ this->blend_mode = blend_mode;
+ this->sorting_context_id = sorting_context_id;
+}
+
+void SharedQuadState::AsValueInto(base::trace_event::TracedValue* value) const {
+ MathUtil::AddToTracedValue("transform", content_to_target_transform, value);
+ MathUtil::AddToTracedValue("layer_content_bounds", content_bounds, value);
+ MathUtil::AddToTracedValue("layer_visible_content_rect", visible_content_rect,
+ value);
+
+ value->SetBoolean("is_clipped", is_clipped);
+
+ MathUtil::AddToTracedValue("clip_rect", clip_rect, value);
+
+ value->SetDouble("opacity", opacity);
+ value->SetString("blend_mode", SkXfermode::ModeName(blend_mode));
+ TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
+ TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"),
+ value,
+ "cc::SharedQuadState",
+ this);
+}
+
+} // namespace cc
« no previous file with comments | « cc/quads/shared_quad_state.h ('k') | cc/quads/solid_color_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698