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

Unified Diff: cc/quads/shared_quad_state.h

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/render_pass_unittest.cc ('k') | cc/quads/shared_quad_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/shared_quad_state.h
diff --git a/cc/quads/shared_quad_state.h b/cc/quads/shared_quad_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..348a9041768a89265d0dc68904914aa51bbcd74e
--- /dev/null
+++ b/cc/quads/shared_quad_state.h
@@ -0,0 +1,60 @@
+// 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.
+
+#ifndef CC_QUADS_SHARED_QUAD_STATE_H_
+#define CC_QUADS_SHARED_QUAD_STATE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "third_party/skia/include/core/SkXfermode.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/transform.h"
+
+namespace base {
+namespace trace_event {
+class TracedValue;
+}
+class Value;
+}
+
+namespace cc {
+
+// SharedQuadState holds a set of properties that are common across multiple
+// DrawQuads. It's purely an optimization - the properties behave in exactly the
+// same way as if they were replicated on each DrawQuad. A given SharedQuadState
+// can only be shared by DrawQuads that are adjacent in their RenderPass'
+// QuadList.
+class SharedQuadState {
+ public:
+ SharedQuadState();
+ ~SharedQuadState();
+
+ void CopyFrom(const SharedQuadState* other);
+
+ void 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);
+ void AsValueInto(base::trace_event::TracedValue* dict) const;
+
+ // Transforms from quad's original content space to its target content space.
+ gfx::Transform content_to_target_transform;
+ // This size lives in the content space for the quad's originating layer.
+ gfx::Size content_bounds;
+ // This rect lives in the content space for the quad's originating layer.
+ gfx::Rect visible_content_rect;
+ // This rect lives in the target content space.
+ gfx::Rect clip_rect;
+ bool is_clipped;
+ float opacity;
+ SkXfermode::Mode blend_mode;
+ int sorting_context_id;
+};
+
+} // namespace cc
+
+#endif // CC_QUADS_SHARED_QUAD_STATE_H_
« no previous file with comments | « cc/quads/render_pass_unittest.cc ('k') | cc/quads/shared_quad_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698