diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-17 19:29:50 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-17 19:29:50 +0000 |
commit | 1bc93f667548c5a5eb9c90c628dea214ebfbed18 (patch) | |
tree | a3447a61157da9c36fa0ad4f0427eb99f3d57174 /cc/render_pass_draw_quad.cc | |
parent | 84b8e013503568c3955fa0ddf8461002a5bd9e63 (diff) | |
download | chromium_src-1bc93f667548c5a5eb9c90c628dea214ebfbed18.zip chromium_src-1bc93f667548c5a5eb9c90c628dea214ebfbed18.tar.gz chromium_src-1bc93f667548c5a5eb9c90c628dea214ebfbed18.tar.bz2 |
cc: Turn DrawQuad into a struct-like class with public data members.
We add a SetAll() method that sets everything to keep the compile-time guard
that verifies everything gets set from all appropriate callsites. This replaces
the constructor which now takes no arguments at all.
We will replace the constructor with an overriding SetAll() for
each subclass of DrawQuads and make them into structs as well.
Covered by existing tests.
TBR=aelias
BUG=152337
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11418047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/render_pass_draw_quad.cc')
-rw-r--r-- | cc/render_pass_draw_quad.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cc/render_pass_draw_quad.cc b/cc/render_pass_draw_quad.cc index c70b3b4..6a06825 100644 --- a/cc/render_pass_draw_quad.cc +++ b/cc/render_pass_draw_quad.cc @@ -12,8 +12,7 @@ scoped_ptr<RenderPassDrawQuad> RenderPassDrawQuad::create(const SharedQuadState* } RenderPassDrawQuad::RenderPassDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, RenderPass::Id renderPassId, bool isReplica, ResourceProvider::ResourceId maskResourceId, const gfx::Rect& contentsChangedSinceLastFrame, float maskTexCoordScaleX, float maskTexCoordScaleY, float maskTexCoordOffsetX, float maskTexCoordOffsetY) - : DrawQuad(sharedQuadState, DrawQuad::RENDER_PASS, quadRect, gfx::Rect()) - , m_renderPassId(renderPassId) + : m_renderPassId(renderPassId) , m_isReplica(isReplica) , m_maskResourceId(maskResourceId) , m_contentsChangedSinceLastFrame(contentsChangedSinceLastFrame) @@ -24,18 +23,23 @@ RenderPassDrawQuad::RenderPassDrawQuad(const SharedQuadState* sharedQuadState, c { DCHECK(m_renderPassId.layerId > 0); DCHECK(m_renderPassId.index >= 0); + + gfx::Rect opaqueRect; + gfx::Rect visibleRect = quadRect; + bool needsBlending = false; + DrawQuad::SetAll(sharedQuadState, DrawQuad::RENDER_PASS, quadRect, opaqueRect, visibleRect, needsBlending); } const RenderPassDrawQuad* RenderPassDrawQuad::materialCast(const DrawQuad* quad) { - DCHECK(quad->material() == DrawQuad::RENDER_PASS); + DCHECK(quad->material == DrawQuad::RENDER_PASS); return static_cast<const RenderPassDrawQuad*>(quad); } scoped_ptr<RenderPassDrawQuad> RenderPassDrawQuad::copy(const SharedQuadState* copiedSharedQuadState, RenderPass::Id copiedRenderPassId) const { scoped_ptr<RenderPassDrawQuad> copyQuad(new RenderPassDrawQuad(*materialCast(this))); - copyQuad->set_shared_quad_state(copiedSharedQuadState); + copyQuad->shared_quad_state = copiedSharedQuadState; copyQuad->m_renderPassId = copiedRenderPassId; return copyQuad.Pass(); } |