OLD | NEW |
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/quads/draw_quad.h" | 5 #include "cc/quads/draw_quad.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/quads/checkerboard_draw_quad.h" | 8 #include "cc/quads/checkerboard_draw_quad.h" |
9 #include "cc/quads/debug_border_draw_quad.h" | 9 #include "cc/quads/debug_border_draw_quad.h" |
10 #include "cc/quads/io_surface_draw_quad.h" | 10 #include "cc/quads/io_surface_draw_quad.h" |
11 #include "cc/quads/render_pass_draw_quad.h" | 11 #include "cc/quads/render_pass_draw_quad.h" |
12 #include "cc/quads/solid_color_draw_quad.h" | 12 #include "cc/quads/solid_color_draw_quad.h" |
13 #include "cc/quads/stream_video_draw_quad.h" | 13 #include "cc/quads/stream_video_draw_quad.h" |
14 #include "cc/quads/texture_draw_quad.h" | 14 #include "cc/quads/texture_draw_quad.h" |
15 #include "cc/quads/tile_draw_quad.h" | 15 #include "cc/quads/tile_draw_quad.h" |
16 #include "cc/quads/yuv_video_draw_quad.h" | 16 #include "cc/quads/yuv_video_draw_quad.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | |
20 template<typename T> T* TypedCopy(const cc::DrawQuad* other) { | 19 template<typename T> T* TypedCopy(const cc::DrawQuad* other) { |
21 return new T(*T::MaterialCast(other)); | 20 return new T(*T::MaterialCast(other)); |
22 } | 21 } |
23 | 22 } // namespace |
24 } | |
25 | 23 |
26 namespace cc { | 24 namespace cc { |
27 | 25 |
28 DrawQuad::DrawQuad() | 26 DrawQuad::DrawQuad() |
29 : material(INVALID), | 27 : material(INVALID), |
30 needs_blending(false), | 28 needs_blending(false), |
31 shared_quad_state() { | 29 shared_quad_state() { |
32 } | 30 } |
33 | 31 |
34 void DrawQuad::SetAll(const SharedQuadState* shared_quad_state, | 32 void DrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 case RENDER_PASS: // RenderPass quads have their own copy() method. | 80 case RENDER_PASS: // RenderPass quads have their own copy() method. |
83 case INVALID: | 81 case INVALID: |
84 LOG(FATAL) << "Invalid DrawQuad material " << material; | 82 LOG(FATAL) << "Invalid DrawQuad material " << material; |
85 break; | 83 break; |
86 } | 84 } |
87 copy_quad->shared_quad_state = copied_shared_quad_state; | 85 copy_quad->shared_quad_state = copied_shared_quad_state; |
88 return copy_quad.Pass(); | 86 return copy_quad.Pass(); |
89 } | 87 } |
90 | 88 |
91 } // namespace cc | 89 } // namespace cc |
OLD | NEW |