summaryrefslogtreecommitdiffstats
path: root/cc/render_pass.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-20 23:06:26 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-20 23:06:26 +0000
commitc22418befbc72b25c7ee2ca8e6fe0a7c9344437e (patch)
tree64f7a701344241c0663aaaf97ba2ce9c04d60c29 /cc/render_pass.cc
parent62669313d2d987074bd63f8d7687bfc314b37d99 (diff)
downloadchromium_src-c22418befbc72b25c7ee2ca8e6fe0a7c9344437e.zip
chromium_src-c22418befbc72b25c7ee2ca8e6fe0a7c9344437e.tar.gz
chromium_src-c22418befbc72b25c7ee2ca8e6fe0a7c9344437e.tar.bz2
cc: Make the DrawQuad subclasses into a struct-like classes.
I've replaced the create() and constructor on each class with a SetNew() method: void SetNew(const SharedQuadState* shared_quad_state, gfx::Rect rect, ...); This method sets everything in the base class, based on the subclass' interpretation of the minimal parameters given to it. This is used when creating a new quad of this type - hence the name. The "..." represents all the quad-type-specific arguments. I've also added a new SetAll() method, that takes all of the data held by this quad type, and simply passes on the appropriate things to the super class: void SetAll(const SharedQuadState* shared_quad_state, gfx::Rect rect, gfx::Rect opaque_rect, gfx::Rect visible_rect, bool needs_blending, ...); This method is used for deserializing, or other cases where you have all the data for the quad well defined, and want to set every field at once. The "..." represents all the quad-type-specific arguments. Added tests for SetAll() in cc_unittests:DrawQuadTest.* TBR=aelias BUG=152337 Review URL: https://chromiumcodereview.appspot.com/11411050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/render_pass.cc')
-rw-r--r--cc/render_pass.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/cc/render_pass.cc b/cc/render_pass.cc
index 01d7877..ac8dea4 100644
--- a/cc/render_pass.cc
+++ b/cc/render_pass.cc
@@ -99,7 +99,9 @@ void RenderPass::appendQuadsToFillScreen(LayerImpl* rootLayer, SkColor screenBac
// The root layer transform is composed of translations and scales only, no perspective, so mapping is sufficient.
gfx::Rect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, fillRects.rect());
// Skip the quad culler and just append the quads directly to avoid occlusion checks.
- m_quadList.append(SolidColorDrawQuad::create(sharedQuadState, layerRect, screenBackgroundColor).PassAs<DrawQuad>());
+ scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
+ quad->SetNew(sharedQuadState, layerRect, screenBackgroundColor);
+ m_quadList.append(quad.PassAs<DrawQuad>());
}
}