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

Unified Diff: cc/quads/draw_quad.cc

Issue 380893004: Move Copy method from DrawQuad to RenderPass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moreRP4DQ
Patch Set: rebase Created 6 years, 5 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/quads/draw_quad.h ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/draw_quad.cc
diff --git a/cc/quads/draw_quad.cc b/cc/quads/draw_quad.cc
index e2d6059a611240eb8006c6c17aade5c94e41293d..b669ad7fe9d2dca05a8c1f60f3009225e716f710 100644
--- a/cc/quads/draw_quad.cc
+++ b/cc/quads/draw_quad.cc
@@ -21,12 +21,6 @@
#include "cc/quads/yuv_video_draw_quad.h"
#include "ui/gfx/quad_f.h"
-namespace {
-template<typename T> T* TypedCopy(const cc::DrawQuad* other) {
- return new T(*T::MaterialCast(other));
-}
-} // namespace
-
namespace cc {
DrawQuad::DrawQuad()
@@ -62,49 +56,6 @@ void DrawQuad::SetAll(const SharedQuadState* shared_quad_state,
DrawQuad::~DrawQuad() {
}
-scoped_ptr<DrawQuad> DrawQuad::Copy(
- const SharedQuadState* copied_shared_quad_state) const {
- scoped_ptr<DrawQuad> copy_quad;
- switch (material) {
- case CHECKERBOARD:
- copy_quad.reset(TypedCopy<CheckerboardDrawQuad>(this));
- break;
- case DEBUG_BORDER:
- copy_quad.reset(TypedCopy<DebugBorderDrawQuad>(this));
- break;
- case IO_SURFACE_CONTENT:
- copy_quad.reset(TypedCopy<IOSurfaceDrawQuad>(this));
- break;
- case PICTURE_CONTENT:
- copy_quad.reset(TypedCopy<PictureDrawQuad>(this));
- break;
- case TEXTURE_CONTENT:
- copy_quad.reset(TypedCopy<TextureDrawQuad>(this));
- break;
- case SOLID_COLOR:
- copy_quad.reset(TypedCopy<SolidColorDrawQuad>(this));
- break;
- case TILED_CONTENT:
- copy_quad.reset(TypedCopy<TileDrawQuad>(this));
- break;
- case STREAM_VIDEO_CONTENT:
- copy_quad.reset(TypedCopy<StreamVideoDrawQuad>(this));
- break;
- case SURFACE_CONTENT:
- copy_quad.reset(TypedCopy<SurfaceDrawQuad>(this));
- break;
- case YUV_VIDEO_CONTENT:
- copy_quad.reset(TypedCopy<YUVVideoDrawQuad>(this));
- break;
- case RENDER_PASS: // RenderPass quads have their own copy() method.
- case INVALID:
- LOG(FATAL) << "Invalid DrawQuad material " << material;
- break;
- }
- copy_quad->shared_quad_state = copied_shared_quad_state;
- return copy_quad.Pass();
-}
-
scoped_ptr<base::Value> DrawQuad::AsValue() const {
scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->SetInteger("material", material);
« no previous file with comments | « cc/quads/draw_quad.h ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698