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

Side by Side Diff: cc/draw_quad.cc

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | cc/draw_quad_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/draw_quad.h" 5 #include "cc/draw_quad.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/checkerboard_draw_quad.h" 8 #include "cc/checkerboard_draw_quad.h"
9 #include "cc/debug_border_draw_quad.h" 9 #include "cc/debug_border_draw_quad.h"
10 #include "cc/io_surface_draw_quad.h" 10 #include "cc/io_surface_draw_quad.h"
11 #include "cc/render_pass_draw_quad.h" 11 #include "cc/render_pass_draw_quad.h"
12 #include "cc/solid_color_draw_quad.h" 12 #include "cc/solid_color_draw_quad.h"
13 #include "cc/stream_video_draw_quad.h" 13 #include "cc/stream_video_draw_quad.h"
14 #include "cc/texture_draw_quad.h" 14 #include "cc/texture_draw_quad.h"
15 #include "cc/tile_draw_quad.h" 15 #include "cc/tile_draw_quad.h"
16 #include "cc/yuv_video_draw_quad.h" 16 #include "cc/yuv_video_draw_quad.h"
17 17
18 namespace { 18 namespace {
19 19
20 template<typename T> T* TypedCopy(const cc::DrawQuad* other) { 20 template<typename T> T* TypedCopy(const cc::DrawQuad* other) {
21 return new T(*T::materialCast(other)); 21 return new T(*T::MaterialCast(other));
22 } 22 }
23 23
24 } 24 }
25 25
26 namespace cc { 26 namespace cc {
27 27
28 DrawQuad::DrawQuad() 28 DrawQuad::DrawQuad()
29 : shared_quad_state(), 29 : shared_quad_state(),
30 material(INVALID), 30 material(INVALID),
31 needs_blending(false) { 31 needs_blending(false) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 case RENDER_PASS: // RenderPass quads have their own copy() method. 83 case RENDER_PASS: // RenderPass quads have their own copy() method.
84 case INVALID: 84 case INVALID:
85 LOG(FATAL) << "Invalid DrawQuad material " << material; 85 LOG(FATAL) << "Invalid DrawQuad material " << material;
86 break; 86 break;
87 } 87 }
88 copy_quad->shared_quad_state = copied_shared_quad_state; 88 copy_quad->shared_quad_state = copied_shared_quad_state;
89 return copy_quad.Pass(); 89 return copy_quad.Pass();
90 } 90 }
91 91
92 } // namespace cc 92 } // namespace cc
OLDNEW
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | cc/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698