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

Side by Side Diff: cc/quads/draw_quad.cc

Issue 12642010: Implement on demand quad rasterization for PicturePiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixes & adding ResizeResource unit test. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
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/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/picture_draw_quad.h"
11 #include "cc/quads/render_pass_draw_quad.h" 12 #include "cc/quads/render_pass_draw_quad.h"
12 #include "cc/quads/solid_color_draw_quad.h" 13 #include "cc/quads/solid_color_draw_quad.h"
13 #include "cc/quads/stream_video_draw_quad.h" 14 #include "cc/quads/stream_video_draw_quad.h"
14 #include "cc/quads/texture_draw_quad.h" 15 #include "cc/quads/texture_draw_quad.h"
15 #include "cc/quads/tile_draw_quad.h" 16 #include "cc/quads/tile_draw_quad.h"
16 #include "cc/quads/yuv_video_draw_quad.h" 17 #include "cc/quads/yuv_video_draw_quad.h"
17 18
18 namespace { 19 namespace {
19 20
20 template<typename T> T* TypedCopy(const cc::DrawQuad* other) { 21 template<typename T> T* TypedCopy(const cc::DrawQuad* other) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 switch (material) { 58 switch (material) {
58 case CHECKERBOARD: 59 case CHECKERBOARD:
59 copy_quad.reset(TypedCopy<CheckerboardDrawQuad>(this)); 60 copy_quad.reset(TypedCopy<CheckerboardDrawQuad>(this));
60 break; 61 break;
61 case DEBUG_BORDER: 62 case DEBUG_BORDER:
62 copy_quad.reset(TypedCopy<DebugBorderDrawQuad>(this)); 63 copy_quad.reset(TypedCopy<DebugBorderDrawQuad>(this));
63 break; 64 break;
64 case IO_SURFACE_CONTENT: 65 case IO_SURFACE_CONTENT:
65 copy_quad.reset(TypedCopy<IOSurfaceDrawQuad>(this)); 66 copy_quad.reset(TypedCopy<IOSurfaceDrawQuad>(this));
66 break; 67 break;
68 case PICTURE_CONTENT:
69 copy_quad.reset(TypedCopy<PictureDrawQuad>(this));
70 break;
67 case TEXTURE_CONTENT: 71 case TEXTURE_CONTENT:
68 copy_quad.reset(TypedCopy<TextureDrawQuad>(this)); 72 copy_quad.reset(TypedCopy<TextureDrawQuad>(this));
69 break; 73 break;
70 case SOLID_COLOR: 74 case SOLID_COLOR:
71 copy_quad.reset(TypedCopy<SolidColorDrawQuad>(this)); 75 copy_quad.reset(TypedCopy<SolidColorDrawQuad>(this));
72 break; 76 break;
73 case TILED_CONTENT: 77 case TILED_CONTENT:
74 copy_quad.reset(TypedCopy<TileDrawQuad>(this)); 78 copy_quad.reset(TypedCopy<TileDrawQuad>(this));
75 break; 79 break;
76 case STREAM_VIDEO_CONTENT: 80 case STREAM_VIDEO_CONTENT:
77 copy_quad.reset(TypedCopy<StreamVideoDrawQuad>(this)); 81 copy_quad.reset(TypedCopy<StreamVideoDrawQuad>(this));
78 break; 82 break;
79 case YUV_VIDEO_CONTENT: 83 case YUV_VIDEO_CONTENT:
80 copy_quad.reset(TypedCopy<YUVVideoDrawQuad>(this)); 84 copy_quad.reset(TypedCopy<YUVVideoDrawQuad>(this));
81 break; 85 break;
82 case RENDER_PASS: // RenderPass quads have their own copy() method. 86 case RENDER_PASS: // RenderPass quads have their own copy() method.
83 case INVALID: 87 case INVALID:
84 LOG(FATAL) << "Invalid DrawQuad material " << material; 88 LOG(FATAL) << "Invalid DrawQuad material " << material;
85 break; 89 break;
86 } 90 }
87 copy_quad->shared_quad_state = copied_shared_quad_state; 91 copy_quad->shared_quad_state = copied_shared_quad_state;
88 return copy_quad.Pass(); 92 return copy_quad.Pass();
89 } 93 }
90 94
91 } // namespace cc 95 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/draw_quad.h ('k') | cc/quads/picture_draw_quad.h » ('j') | cc/quads/picture_draw_quad.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698