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

Unified Diff: cc/shared_quad_state.cc

Issue 11416088: cc: Turn SharedQuadState into a struct-like class similar to DrawQuads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix debug build Created 8 years, 1 month 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/shared_quad_state.h ('k') | cc/software_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/shared_quad_state.cc
diff --git a/cc/shared_quad_state.cc b/cc/shared_quad_state.cc
index 94505bc2da77c7c56c5ca7a0e6d91232a5a019f1..af47fd79c0c0d92feffc8f48c426595ae8f4dcc6 100644
--- a/cc/shared_quad_state.cc
+++ b/cc/shared_quad_state.cc
@@ -6,25 +6,25 @@
namespace cc {
-scoped_ptr<SharedQuadState> SharedQuadState::create(const WebKit::WebTransformationMatrix& quadTransform, const gfx::Rect& visibleContentRect, const gfx::Rect& clippedRectInTarget, float opacity)
-{
- return make_scoped_ptr(new SharedQuadState(quadTransform, visibleContentRect, clippedRectInTarget, opacity));
+SharedQuadState::SharedQuadState() : opacity(0) {}
+
+scoped_ptr<SharedQuadState> SharedQuadState::Create() {
+ return make_scoped_ptr(new SharedQuadState);
}
-SharedQuadState::SharedQuadState(const WebKit::WebTransformationMatrix& quadTransform, const gfx::Rect& visibleContentRect, const gfx::Rect& clippedRectInTarget, float opacity)
- : id(-1)
- , quadTransform(quadTransform)
- , visibleContentRect(visibleContentRect)
- , clippedRectInTarget(clippedRectInTarget)
- , opacity(opacity)
-{
+scoped_ptr<SharedQuadState> SharedQuadState::Copy() const {
+ return make_scoped_ptr(new SharedQuadState(*this));
}
-scoped_ptr<SharedQuadState> SharedQuadState::copy() const
-{
- scoped_ptr<SharedQuadState> copiedState(create(quadTransform, visibleContentRect, clippedRectInTarget, opacity));
- copiedState->id = id;
- return copiedState.Pass();
+void SharedQuadState::SetAll(
+ const WebKit::WebTransformationMatrix& content_to_target_transform,
+ const gfx::Rect& visible_content_rect,
+ const gfx::Rect& clipped_rect_in_target,
+ float opacity) {
+ this->content_to_target_transform = content_to_target_transform;
+ this->visible_content_rect = visible_content_rect;
+ this->clipped_rect_in_target = clipped_rect_in_target;
+ this->opacity = opacity;
}
} // namespace cc
« no previous file with comments | « cc/shared_quad_state.h ('k') | cc/software_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698