| 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/test/render_pass_test_common.h" | 5 #include "cc/test/render_pass_test_common.h" |
| 6 | 6 |
| 7 #include "cc/checkerboard_draw_quad.h" | 7 #include "cc/checkerboard_draw_quad.h" |
| 8 #include "cc/debug_border_draw_quad.h" | 8 #include "cc/debug_border_draw_quad.h" |
| 9 #include "cc/io_surface_draw_quad.h" | 9 #include "cc/io_surface_draw_quad.h" |
| 10 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 gfx::RectF(), | 76 gfx::RectF(), |
| 77 WebKit::WebFilterOperations(), | 77 WebKit::WebFilterOperations(), |
| 78 skia::RefPtr<SkImageFilter>(), | 78 skia::RefPtr<SkImageFilter>(), |
| 79 WebKit::WebFilterOperations()); | 79 WebKit::WebFilterOperations()); |
| 80 AppendQuad(render_pass_quad.PassAs<DrawQuad>()); | 80 AppendQuad(render_pass_quad.PassAs<DrawQuad>()); |
| 81 | 81 |
| 82 scoped_ptr<cc::SolidColorDrawQuad> solid_color_quad = | 82 scoped_ptr<cc::SolidColorDrawQuad> solid_color_quad = |
| 83 cc::SolidColorDrawQuad::Create(); | 83 cc::SolidColorDrawQuad::Create(); |
| 84 solid_color_quad->SetNew(shared_state.get(), | 84 solid_color_quad->SetNew(shared_state.get(), |
| 85 rect, | 85 rect, |
| 86 DrawQuad::AntiAliasing(), |
| 86 SK_ColorRED); | 87 SK_ColorRED); |
| 87 AppendQuad(solid_color_quad.PassAs<DrawQuad>()); | 88 AppendQuad(solid_color_quad.PassAs<DrawQuad>()); |
| 88 | 89 |
| 89 scoped_ptr<cc::StreamVideoDrawQuad> stream_video_quad = | 90 scoped_ptr<cc::StreamVideoDrawQuad> stream_video_quad = |
| 90 cc::StreamVideoDrawQuad::Create(); | 91 cc::StreamVideoDrawQuad::Create(); |
| 91 stream_video_quad->SetNew(shared_state.get(), | 92 stream_video_quad->SetNew(shared_state.get(), |
| 92 rect, | 93 rect, |
| 93 opaque_rect, | 94 opaque_rect, |
| 94 texture_id, | 95 texture_id, |
| 95 gfx::Transform()); | 96 gfx::Transform()); |
| 96 AppendQuad(stream_video_quad.PassAs<DrawQuad>()); | 97 AppendQuad(stream_video_quad.PassAs<DrawQuad>()); |
| 97 | 98 |
| 98 scoped_ptr<cc::TextureDrawQuad> texture_quad = | 99 scoped_ptr<cc::TextureDrawQuad> texture_quad = |
| 99 cc::TextureDrawQuad::Create(); | 100 cc::TextureDrawQuad::Create(); |
| 100 texture_quad->SetNew(shared_state.get(), | 101 texture_quad->SetNew(shared_state.get(), |
| 101 rect, | 102 rect, |
| 102 opaque_rect, | 103 opaque_rect, |
| 103 texture_resource, | 104 texture_resource, |
| 104 false, | 105 false, |
| 105 rect, | 106 rect, |
| 106 vertex_opacity, | 107 vertex_opacity, |
| 107 false); | 108 false); |
| 108 AppendQuad(texture_quad.PassAs<DrawQuad>()); | 109 AppendQuad(texture_quad.PassAs<DrawQuad>()); |
| 109 | 110 |
| 110 scoped_ptr<cc::TileDrawQuad> scaled_tile_quad = | 111 scoped_ptr<cc::TileDrawQuad> scaled_tile_quad = |
| 111 cc::TileDrawQuad::Create(); | 112 cc::TileDrawQuad::Create(); |
| 112 scaled_tile_quad->SetNew(shared_state.get(), | 113 scaled_tile_quad->SetNew(shared_state.get(), |
| 113 rect, | 114 rect, |
| 114 opaque_rect, | 115 opaque_rect, |
| 116 DrawQuad::AntiAliasing(), |
| 115 texture_resource, | 117 texture_resource, |
| 116 gfx::RectF(0, 0, 50, 50), | 118 gfx::RectF(0, 0, 50, 50), |
| 117 gfx::Size(50, 50), | 119 gfx::Size(50, 50), |
| 118 false, | |
| 119 false, | |
| 120 false, | |
| 121 false, | |
| 122 false); | 120 false); |
| 123 AppendQuad(scaled_tile_quad.PassAs<DrawQuad>()); | 121 AppendQuad(scaled_tile_quad.PassAs<DrawQuad>()); |
| 124 | 122 |
| 125 scoped_ptr<cc::SharedQuadState> transformed_state = shared_state->Copy(); | 123 scoped_ptr<cc::SharedQuadState> transformed_state = shared_state->Copy(); |
| 126 gfx::Transform rotation; | 124 gfx::Transform rotation; |
| 127 rotation.Rotate(45); | 125 rotation.Rotate(45); |
| 128 transformed_state->content_to_target_transform = transformed_state->content_to
_target_transform * rotation; | 126 transformed_state->content_to_target_transform = transformed_state->content_to
_target_transform * rotation; |
| 129 scoped_ptr<cc::TileDrawQuad> transformed_tile_quad = | 127 scoped_ptr<cc::TileDrawQuad> transformed_tile_quad = |
| 130 cc::TileDrawQuad::Create(); | 128 cc::TileDrawQuad::Create(); |
| 131 transformed_tile_quad->SetNew(transformed_state.get(), | 129 transformed_tile_quad->SetNew(transformed_state.get(), |
| 132 rect, | 130 rect, |
| 133 opaque_rect, | 131 opaque_rect, |
| 132 DrawQuad::AntiAliasing(), |
| 134 texture_resource, | 133 texture_resource, |
| 135 gfx::RectF(0, 0, 100, 100), | 134 gfx::RectF(0, 0, 100, 100), |
| 136 gfx::Size(100, 100), | 135 gfx::Size(100, 100), |
| 137 false, | |
| 138 false, | |
| 139 false, | |
| 140 false, | |
| 141 false); | 136 false); |
| 142 AppendQuad(transformed_tile_quad.PassAs<DrawQuad>()); | 137 AppendQuad(transformed_tile_quad.PassAs<DrawQuad>()); |
| 143 | 138 |
| 144 scoped_ptr<cc::TileDrawQuad> tile_quad = | 139 scoped_ptr<cc::TileDrawQuad> tile_quad = |
| 145 cc::TileDrawQuad::Create(); | 140 cc::TileDrawQuad::Create(); |
| 146 tile_quad->SetNew(shared_state.get(), | 141 tile_quad->SetNew(shared_state.get(), |
| 147 rect, | 142 rect, |
| 148 opaque_rect, | 143 opaque_rect, |
| 144 DrawQuad::AntiAliasing(), |
| 149 texture_resource, | 145 texture_resource, |
| 150 gfx::RectF(0, 0, 100, 100), | 146 gfx::RectF(0, 0, 100, 100), |
| 151 gfx::Size(100, 100), | 147 gfx::Size(100, 100), |
| 152 false, | |
| 153 false, | |
| 154 false, | |
| 155 false, | |
| 156 false); | 148 false); |
| 157 AppendQuad(tile_quad.PassAs<DrawQuad>()); | 149 AppendQuad(tile_quad.PassAs<DrawQuad>()); |
| 158 | 150 |
| 159 cc::VideoLayerImpl::FramePlane planes[3]; | 151 cc::VideoLayerImpl::FramePlane planes[3]; |
| 160 for (int i = 0; i < 3; ++i) { | 152 for (int i = 0; i < 3; ++i) { |
| 161 planes[i].resourceId = | 153 planes[i].resourceId = |
| 162 resourceProvider->createResource( | 154 resourceProvider->createResource( |
| 163 gfx::Size(20, 12), | 155 gfx::Size(20, 12), |
| 164 resourceProvider->bestTextureFormat(), | 156 resourceProvider->bestTextureFormat(), |
| 165 ResourceProvider::TextureUsageAny); | 157 ResourceProvider::TextureUsageAny); |
| 166 planes[i].size = gfx::Size(100, 100); | 158 planes[i].size = gfx::Size(100, 100); |
| 167 planes[i].format = GL_LUMINANCE; | 159 planes[i].format = GL_LUMINANCE; |
| 168 } | 160 } |
| 169 scoped_ptr<cc::YUVVideoDrawQuad> yuv_quad = | 161 scoped_ptr<cc::YUVVideoDrawQuad> yuv_quad = |
| 170 cc::YUVVideoDrawQuad::Create(); | 162 cc::YUVVideoDrawQuad::Create(); |
| 171 yuv_quad->SetNew(shared_state.get(), | 163 yuv_quad->SetNew(shared_state.get(), |
| 172 rect, | 164 rect, |
| 173 opaque_rect, | 165 opaque_rect, |
| 174 gfx::Size(100, 100), | 166 gfx::Size(100, 100), |
| 175 planes[0], | 167 planes[0], |
| 176 planes[1], | 168 planes[1], |
| 177 planes[2]); | 169 planes[2]); |
| 178 AppendQuad(yuv_quad.PassAs<DrawQuad>()); | 170 AppendQuad(yuv_quad.PassAs<DrawQuad>()); |
| 179 | 171 |
| 180 AppendSharedQuadState(transformed_state.Pass()); | 172 AppendSharedQuadState(transformed_state.Pass()); |
| 181 AppendSharedQuadState(shared_state.Pass()); | 173 AppendSharedQuadState(shared_state.Pass()); |
| 182 } | 174 } |
| 183 | 175 |
| 184 } // namespace cc | 176 } // namespace cc |
| OLD | NEW |