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

Unified Diff: cc/render_pass_draw_quad.cc

Issue 11344050: Fix DrawQuad copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 8 years, 2 months 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/render_pass_draw_quad.h ('k') | cc/yuv_video_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/render_pass_draw_quad.cc
diff --git a/cc/render_pass_draw_quad.cc b/cc/render_pass_draw_quad.cc
index 6780caa6b8776a2c946bd78aaf8e5899c134b05a..37ed51ef0d9cd6d065e6fcf344b4cbcf9b26d36a 100644
--- a/cc/render_pass_draw_quad.cc
+++ b/cc/render_pass_draw_quad.cc
@@ -36,14 +36,9 @@ const RenderPassDrawQuad* RenderPassDrawQuad::materialCast(const DrawQuad* quad)
scoped_ptr<RenderPassDrawQuad> RenderPassDrawQuad::copy(const SharedQuadState* copiedSharedQuadState, RenderPass::Id copiedRenderPassId) const
{
- unsigned bytes = size();
- DCHECK(bytes > 0);
-
- scoped_ptr<RenderPassDrawQuad> copyQuad(reinterpret_cast<RenderPassDrawQuad*>(new char[bytes]));
- memcpy(copyQuad.get(), this, bytes);
+ scoped_ptr<RenderPassDrawQuad> copyQuad(new RenderPassDrawQuad(*materialCast(this)));
copyQuad->setSharedQuadState(copiedSharedQuadState);
copyQuad->m_renderPassId = copiedRenderPassId;
-
return copyQuad.Pass();
}
« no previous file with comments | « cc/render_pass_draw_quad.h ('k') | cc/yuv_video_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698