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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "cc/output/gl_renderer.h" | 6 #include "cc/output/gl_renderer.h" |
7 #include "cc/quads/draw_quad.h" | 7 #include "cc/quads/draw_quad.h" |
8 #include "cc/quads/picture_draw_quad.h" | 8 #include "cc/quads/picture_draw_quad.h" |
9 #include "cc/quads/texture_draw_quad.h" | 9 #include "cc/quads/texture_draw_quad.h" |
10 #include "cc/resources/video_resource_updater.h" | 10 #include "cc/resources/video_resource_updater.h" |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 SkPaint blue_paint; | 754 SkPaint blue_paint; |
755 blue_paint.setColor(SK_ColorBLUE); | 755 blue_paint.setColor(SK_ColorBLUE); |
756 SkPaint green_paint; | 756 SkPaint green_paint; |
757 green_paint.setColor(SK_ColorGREEN); | 757 green_paint.setColor(SK_ColorGREEN); |
758 | 758 |
759 scoped_ptr<FakePicturePile> blue_recording = | 759 scoped_ptr<FakePicturePile> blue_recording = |
760 FakePicturePile::CreateFilledPile(gfx::Size(1000, 1000), | 760 FakePicturePile::CreateFilledPile(gfx::Size(1000, 1000), |
761 this->quad_rect_.size()); | 761 this->quad_rect_.size()); |
762 blue_recording->add_draw_rect_with_paint(outer_rect, black_paint); | 762 blue_recording->add_draw_rect_with_paint(outer_rect, black_paint); |
763 blue_recording->add_draw_rect_with_paint(inner_rect, blue_paint); | 763 blue_recording->add_draw_rect_with_paint(inner_rect, blue_paint); |
764 blue_recording->RerecordPile(); | 764 blue_recording->Rerecord(); |
765 scoped_refptr<FakePicturePileImpl> blue_pile = | 765 scoped_refptr<FakePicturePileImpl> blue_pile = |
766 FakePicturePileImpl::CreateFromPile(blue_recording.get(), nullptr); | 766 FakePicturePileImpl::CreateFromPile(blue_recording.get(), nullptr); |
767 | 767 |
768 PictureDrawQuad* blue_quad = | 768 PictureDrawQuad* blue_quad = |
769 this->render_pass_->template CreateAndAppendDrawQuad<PictureDrawQuad>(); | 769 this->render_pass_->template CreateAndAppendDrawQuad<PictureDrawQuad>(); |
770 | 770 |
771 blue_quad->SetNew(this->front_quad_state_, this->quad_rect_, gfx::Rect(), | 771 blue_quad->SetNew(this->front_quad_state_, this->quad_rect_, gfx::Rect(), |
772 this->quad_rect_, this->quad_rect_, this->quad_rect_.size(), | 772 this->quad_rect_, this->quad_rect_, this->quad_rect_.size(), |
773 false, RGBA_8888, this->quad_rect_, 1.f, blue_pile); | 773 false, RGBA_8888, this->quad_rect_, 1.f, blue_pile); |
774 | 774 |
775 scoped_ptr<FakePicturePile> green_recording = | 775 scoped_ptr<FakePicturePile> green_recording = |
776 FakePicturePile::CreateFilledPile(this->quad_rect_.size(), | 776 FakePicturePile::CreateFilledPile(this->quad_rect_.size(), |
777 this->quad_rect_.size()); | 777 this->quad_rect_.size()); |
778 green_recording->add_draw_rect_with_paint(outer_rect, green_paint); | 778 green_recording->add_draw_rect_with_paint(outer_rect, green_paint); |
779 green_recording->add_draw_rect_with_paint(inner_rect, black_paint); | 779 green_recording->add_draw_rect_with_paint(inner_rect, black_paint); |
780 green_recording->RerecordPile(); | 780 green_recording->Rerecord(); |
781 scoped_refptr<FakePicturePileImpl> green_pile = | 781 scoped_refptr<FakePicturePileImpl> green_pile = |
782 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); | 782 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); |
783 | 783 |
784 PictureDrawQuad* green_quad = | 784 PictureDrawQuad* green_quad = |
785 this->render_pass_->template CreateAndAppendDrawQuad<PictureDrawQuad>(); | 785 this->render_pass_->template CreateAndAppendDrawQuad<PictureDrawQuad>(); |
786 green_quad->SetNew(this->back_quad_state_, this->quad_rect_, gfx::Rect(), | 786 green_quad->SetNew(this->back_quad_state_, this->quad_rect_, gfx::Rect(), |
787 this->quad_rect_, this->quad_rect_, | 787 this->quad_rect_, this->quad_rect_, |
788 this->quad_rect_.size(), false, RGBA_8888, | 788 this->quad_rect_.size(), false, RGBA_8888, |
789 this->quad_rect_, 1.f, green_pile); | 789 this->quad_rect_, 1.f, green_pile); |
790 SCOPED_TRACE("IntersectingPictureQuadsPass"); | 790 SCOPED_TRACE("IntersectingPictureQuadsPass"); |
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2188 gfx::Rect blue_clip_rect(gfx::Point(50, 50), gfx::Size(50, 50)); | 2188 gfx::Rect blue_clip_rect(gfx::Point(50, 50), gfx::Size(50, 50)); |
2189 | 2189 |
2190 scoped_ptr<FakePicturePile> blue_recording = | 2190 scoped_ptr<FakePicturePile> blue_recording = |
2191 FakePicturePile::CreateFilledPile(pile_tile_size, blue_rect.size()); | 2191 FakePicturePile::CreateFilledPile(pile_tile_size, blue_rect.size()); |
2192 SkPaint red_paint; | 2192 SkPaint red_paint; |
2193 red_paint.setColor(SK_ColorRED); | 2193 red_paint.setColor(SK_ColorRED); |
2194 blue_recording->add_draw_rect_with_paint(blue_rect, red_paint); | 2194 blue_recording->add_draw_rect_with_paint(blue_rect, red_paint); |
2195 SkPaint blue_paint; | 2195 SkPaint blue_paint; |
2196 blue_paint.setColor(SK_ColorBLUE); | 2196 blue_paint.setColor(SK_ColorBLUE); |
2197 blue_recording->add_draw_rect_with_paint(blue_clip_rect, blue_paint); | 2197 blue_recording->add_draw_rect_with_paint(blue_clip_rect, blue_paint); |
2198 blue_recording->RerecordPile(); | 2198 blue_recording->Rerecord(); |
2199 | 2199 |
2200 scoped_refptr<FakePicturePileImpl> blue_pile = | 2200 scoped_refptr<FakePicturePileImpl> blue_pile = |
2201 FakePicturePileImpl::CreateFromPile(blue_recording.get(), nullptr); | 2201 FakePicturePileImpl::CreateFromPile(blue_recording.get(), nullptr); |
2202 | 2202 |
2203 gfx::Transform blue_content_to_target_transform; | 2203 gfx::Transform blue_content_to_target_transform; |
2204 gfx::Vector2d offset(viewport.bottom_right() - blue_rect.bottom_right()); | 2204 gfx::Vector2d offset(viewport.bottom_right() - blue_rect.bottom_right()); |
2205 blue_content_to_target_transform.Translate(offset.x(), offset.y()); | 2205 blue_content_to_target_transform.Translate(offset.x(), offset.y()); |
2206 gfx::RectF blue_scissor_rect = blue_clip_rect; | 2206 gfx::RectF blue_scissor_rect = blue_clip_rect; |
2207 blue_content_to_target_transform.TransformRect(&blue_scissor_rect); | 2207 blue_content_to_target_transform.TransformRect(&blue_scissor_rect); |
2208 SharedQuadState* blue_shared_state = | 2208 SharedQuadState* blue_shared_state = |
2209 CreateTestSharedQuadStateClipped(blue_content_to_target_transform, | 2209 CreateTestSharedQuadStateClipped(blue_content_to_target_transform, |
2210 blue_rect, | 2210 blue_rect, |
2211 gfx::ToEnclosingRect(blue_scissor_rect), | 2211 gfx::ToEnclosingRect(blue_scissor_rect), |
2212 pass.get()); | 2212 pass.get()); |
2213 | 2213 |
2214 PictureDrawQuad* blue_quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2214 PictureDrawQuad* blue_quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2215 | 2215 |
2216 blue_quad->SetNew(blue_shared_state, | 2216 blue_quad->SetNew(blue_shared_state, |
2217 viewport, // Intentionally bigger than clip. | 2217 viewport, // Intentionally bigger than clip. |
2218 gfx::Rect(), viewport, gfx::RectF(viewport), | 2218 gfx::Rect(), viewport, gfx::RectF(viewport), |
2219 viewport.size(), nearest_neighbor, texture_format, viewport, | 2219 viewport.size(), nearest_neighbor, texture_format, viewport, |
2220 1.f, blue_pile.get()); | 2220 1.f, blue_pile.get()); |
2221 | 2221 |
2222 // One viewport-filling green quad. | 2222 // One viewport-filling green quad. |
2223 scoped_ptr<FakePicturePile> green_recording = | 2223 scoped_ptr<FakePicturePile> green_recording = |
2224 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); | 2224 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); |
2225 SkPaint green_paint; | 2225 SkPaint green_paint; |
2226 green_paint.setColor(SK_ColorGREEN); | 2226 green_paint.setColor(SK_ColorGREEN); |
2227 green_recording->add_draw_rect_with_paint(viewport, green_paint); | 2227 green_recording->add_draw_rect_with_paint(viewport, green_paint); |
2228 green_recording->RerecordPile(); | 2228 green_recording->Rerecord(); |
2229 scoped_refptr<FakePicturePileImpl> green_pile = | 2229 scoped_refptr<FakePicturePileImpl> green_pile = |
2230 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); | 2230 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); |
2231 | 2231 |
2232 gfx::Transform green_content_to_target_transform; | 2232 gfx::Transform green_content_to_target_transform; |
2233 SharedQuadState* green_shared_state = CreateTestSharedQuadState( | 2233 SharedQuadState* green_shared_state = CreateTestSharedQuadState( |
2234 green_content_to_target_transform, viewport, pass.get()); | 2234 green_content_to_target_transform, viewport, pass.get()); |
2235 | 2235 |
2236 PictureDrawQuad* green_quad = | 2236 PictureDrawQuad* green_quad = |
2237 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2237 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2238 green_quad->SetNew(green_shared_state, viewport, gfx::Rect(), viewport, | 2238 green_quad->SetNew(green_shared_state, viewport, gfx::Rect(), viewport, |
(...skipping 21 matching lines...) Expand all Loading... |
2260 gfx::Transform transform_to_root; | 2260 gfx::Transform transform_to_root; |
2261 scoped_ptr<RenderPass> pass = | 2261 scoped_ptr<RenderPass> pass = |
2262 CreateTestRenderPass(id, viewport, transform_to_root); | 2262 CreateTestRenderPass(id, viewport, transform_to_root); |
2263 | 2263 |
2264 // One viewport-filling 0.5-opacity green quad. | 2264 // One viewport-filling 0.5-opacity green quad. |
2265 scoped_ptr<FakePicturePile> green_recording = | 2265 scoped_ptr<FakePicturePile> green_recording = |
2266 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); | 2266 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); |
2267 SkPaint green_paint; | 2267 SkPaint green_paint; |
2268 green_paint.setColor(SK_ColorGREEN); | 2268 green_paint.setColor(SK_ColorGREEN); |
2269 green_recording->add_draw_rect_with_paint(viewport, green_paint); | 2269 green_recording->add_draw_rect_with_paint(viewport, green_paint); |
2270 green_recording->RerecordPile(); | 2270 green_recording->Rerecord(); |
2271 scoped_refptr<FakePicturePileImpl> green_pile = | 2271 scoped_refptr<FakePicturePileImpl> green_pile = |
2272 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); | 2272 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); |
2273 | 2273 |
2274 gfx::Transform green_content_to_target_transform; | 2274 gfx::Transform green_content_to_target_transform; |
2275 SharedQuadState* green_shared_state = CreateTestSharedQuadState( | 2275 SharedQuadState* green_shared_state = CreateTestSharedQuadState( |
2276 green_content_to_target_transform, viewport, pass.get()); | 2276 green_content_to_target_transform, viewport, pass.get()); |
2277 green_shared_state->opacity = 0.5f; | 2277 green_shared_state->opacity = 0.5f; |
2278 | 2278 |
2279 PictureDrawQuad* green_quad = | 2279 PictureDrawQuad* green_quad = |
2280 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2280 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2281 green_quad->SetNew(green_shared_state, viewport, gfx::Rect(), viewport, | 2281 green_quad->SetNew(green_shared_state, viewport, gfx::Rect(), viewport, |
2282 gfx::RectF(0, 0, 1, 1), viewport.size(), nearest_neighbor, | 2282 gfx::RectF(0, 0, 1, 1), viewport.size(), nearest_neighbor, |
2283 texture_format, viewport, 1.f, green_pile.get()); | 2283 texture_format, viewport, 1.f, green_pile.get()); |
2284 | 2284 |
2285 // One viewport-filling white quad. | 2285 // One viewport-filling white quad. |
2286 scoped_ptr<FakePicturePile> white_recording = | 2286 scoped_ptr<FakePicturePile> white_recording = |
2287 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); | 2287 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); |
2288 SkPaint white_paint; | 2288 SkPaint white_paint; |
2289 white_paint.setColor(SK_ColorWHITE); | 2289 white_paint.setColor(SK_ColorWHITE); |
2290 white_recording->add_draw_rect_with_paint(viewport, white_paint); | 2290 white_recording->add_draw_rect_with_paint(viewport, white_paint); |
2291 white_recording->RerecordPile(); | 2291 white_recording->Rerecord(); |
2292 scoped_refptr<FakePicturePileImpl> white_pile = | 2292 scoped_refptr<FakePicturePileImpl> white_pile = |
2293 FakePicturePileImpl::CreateFromPile(white_recording.get(), nullptr); | 2293 FakePicturePileImpl::CreateFromPile(white_recording.get(), nullptr); |
2294 | 2294 |
2295 gfx::Transform white_content_to_target_transform; | 2295 gfx::Transform white_content_to_target_transform; |
2296 SharedQuadState* white_shared_state = CreateTestSharedQuadState( | 2296 SharedQuadState* white_shared_state = CreateTestSharedQuadState( |
2297 white_content_to_target_transform, viewport, pass.get()); | 2297 white_content_to_target_transform, viewport, pass.get()); |
2298 | 2298 |
2299 PictureDrawQuad* white_quad = | 2299 PictureDrawQuad* white_quad = |
2300 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2300 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2301 white_quad->SetNew(white_shared_state, viewport, gfx::Rect(), viewport, | 2301 white_quad->SetNew(white_shared_state, viewport, gfx::Rect(), viewport, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 canvas.drawPoint(0, 1, SK_ColorBLUE); | 2352 canvas.drawPoint(0, 1, SK_ColorBLUE); |
2353 canvas.drawPoint(1, 0, SK_ColorBLUE); | 2353 canvas.drawPoint(1, 0, SK_ColorBLUE); |
2354 canvas.drawPoint(1, 1, SK_ColorGREEN); | 2354 canvas.drawPoint(1, 1, SK_ColorGREEN); |
2355 } | 2355 } |
2356 | 2356 |
2357 scoped_ptr<FakePicturePile> recording = | 2357 scoped_ptr<FakePicturePile> recording = |
2358 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); | 2358 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); |
2359 SkPaint paint; | 2359 SkPaint paint; |
2360 paint.setFilterQuality(kLow_SkFilterQuality); | 2360 paint.setFilterQuality(kLow_SkFilterQuality); |
2361 recording->add_draw_bitmap_with_paint(bitmap, gfx::Point(), paint); | 2361 recording->add_draw_bitmap_with_paint(bitmap, gfx::Point(), paint); |
2362 recording->RerecordPile(); | 2362 recording->Rerecord(); |
2363 scoped_refptr<FakePicturePileImpl> pile = | 2363 scoped_refptr<FakePicturePileImpl> pile = |
2364 FakePicturePileImpl::CreateFromPile(recording.get(), nullptr); | 2364 FakePicturePileImpl::CreateFromPile(recording.get(), nullptr); |
2365 | 2365 |
2366 gfx::Transform content_to_target_transform; | 2366 gfx::Transform content_to_target_transform; |
2367 SharedQuadState* shared_state = CreateTestSharedQuadState( | 2367 SharedQuadState* shared_state = CreateTestSharedQuadState( |
2368 content_to_target_transform, viewport, pass.get()); | 2368 content_to_target_transform, viewport, pass.get()); |
2369 | 2369 |
2370 PictureDrawQuad* quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2370 PictureDrawQuad* quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2371 quad->SetNew(shared_state, viewport, gfx::Rect(), viewport, | 2371 quad->SetNew(shared_state, viewport, gfx::Rect(), viewport, |
2372 gfx::RectF(0, 0, 2, 2), viewport.size(), nearest_neighbor, | 2372 gfx::RectF(0, 0, 2, 2), viewport.size(), nearest_neighbor, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2404 canvas.drawPoint(0, 1, SK_ColorBLUE); | 2404 canvas.drawPoint(0, 1, SK_ColorBLUE); |
2405 canvas.drawPoint(1, 0, SK_ColorBLUE); | 2405 canvas.drawPoint(1, 0, SK_ColorBLUE); |
2406 canvas.drawPoint(1, 1, SK_ColorGREEN); | 2406 canvas.drawPoint(1, 1, SK_ColorGREEN); |
2407 } | 2407 } |
2408 | 2408 |
2409 scoped_ptr<FakePicturePile> recording = | 2409 scoped_ptr<FakePicturePile> recording = |
2410 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); | 2410 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); |
2411 SkPaint paint; | 2411 SkPaint paint; |
2412 paint.setFilterQuality(kLow_SkFilterQuality); | 2412 paint.setFilterQuality(kLow_SkFilterQuality); |
2413 recording->add_draw_bitmap_with_paint(bitmap, gfx::Point(), paint); | 2413 recording->add_draw_bitmap_with_paint(bitmap, gfx::Point(), paint); |
2414 recording->RerecordPile(); | 2414 recording->Rerecord(); |
2415 scoped_refptr<FakePicturePileImpl> pile = | 2415 scoped_refptr<FakePicturePileImpl> pile = |
2416 FakePicturePileImpl::CreateFromPile(recording.get(), nullptr); | 2416 FakePicturePileImpl::CreateFromPile(recording.get(), nullptr); |
2417 | 2417 |
2418 gfx::Transform content_to_target_transform; | 2418 gfx::Transform content_to_target_transform; |
2419 SharedQuadState* shared_state = CreateTestSharedQuadState( | 2419 SharedQuadState* shared_state = CreateTestSharedQuadState( |
2420 content_to_target_transform, viewport, pass.get()); | 2420 content_to_target_transform, viewport, pass.get()); |
2421 | 2421 |
2422 PictureDrawQuad* quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2422 PictureDrawQuad* quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2423 quad->SetNew(shared_state, viewport, gfx::Rect(), viewport, | 2423 quad->SetNew(shared_state, viewport, gfx::Rect(), viewport, |
2424 gfx::RectF(0, 0, 2, 2), viewport.size(), nearest_neighbor, | 2424 gfx::RectF(0, 0, 2, 2), viewport.size(), nearest_neighbor, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2508 scoped_ptr<FakePicturePile> green_recording = | 2508 scoped_ptr<FakePicturePile> green_recording = |
2509 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); | 2509 FakePicturePile::CreateFilledPile(pile_tile_size, viewport.size()); |
2510 | 2510 |
2511 SkPaint red_paint; | 2511 SkPaint red_paint; |
2512 red_paint.setColor(SK_ColorRED); | 2512 red_paint.setColor(SK_ColorRED); |
2513 green_recording->add_draw_rect_with_paint(viewport, red_paint); | 2513 green_recording->add_draw_rect_with_paint(viewport, red_paint); |
2514 SkPaint green_paint; | 2514 SkPaint green_paint; |
2515 green_paint.setColor(SK_ColorGREEN); | 2515 green_paint.setColor(SK_ColorGREEN); |
2516 green_recording->add_draw_rect_with_paint(green_rect1, green_paint); | 2516 green_recording->add_draw_rect_with_paint(green_rect1, green_paint); |
2517 green_recording->add_draw_rect_with_paint(green_rect2, green_paint); | 2517 green_recording->add_draw_rect_with_paint(green_rect2, green_paint); |
2518 green_recording->RerecordPile(); | 2518 green_recording->Rerecord(); |
2519 scoped_refptr<FakePicturePileImpl> green_pile = | 2519 scoped_refptr<FakePicturePileImpl> green_pile = |
2520 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); | 2520 FakePicturePileImpl::CreateFromPile(green_recording.get(), nullptr); |
2521 | 2521 |
2522 SharedQuadState* top_right_green_shared_quad_state = | 2522 SharedQuadState* top_right_green_shared_quad_state = |
2523 CreateTestSharedQuadState( | 2523 CreateTestSharedQuadState( |
2524 green_content_to_target_transform, viewport, pass.get()); | 2524 green_content_to_target_transform, viewport, pass.get()); |
2525 | 2525 |
2526 PictureDrawQuad* green_quad1 = | 2526 PictureDrawQuad* green_quad1 = |
2527 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); | 2527 pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); |
2528 green_quad1->SetNew(top_right_green_shared_quad_state, green_rect1, | 2528 green_quad1->SetNew(top_right_green_shared_quad_state, green_rect1, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2578 Region outside(layer_rect); | 2578 Region outside(layer_rect); |
2579 outside.Subtract(gfx::ToEnclosingRect(union_layer_rect)); | 2579 outside.Subtract(gfx::ToEnclosingRect(union_layer_rect)); |
2580 for (Region::Iterator iter(outside); iter.has_rect(); iter.next()) { | 2580 for (Region::Iterator iter(outside); iter.has_rect(); iter.next()) { |
2581 recording->add_draw_rect_with_paint(iter.rect(), red_paint); | 2581 recording->add_draw_rect_with_paint(iter.rect(), red_paint); |
2582 } | 2582 } |
2583 | 2583 |
2584 SkPaint blue_paint; | 2584 SkPaint blue_paint; |
2585 blue_paint.setColor(SK_ColorBLUE); | 2585 blue_paint.setColor(SK_ColorBLUE); |
2586 recording->add_draw_rect_with_paint(blue_layer_rect1, blue_paint); | 2586 recording->add_draw_rect_with_paint(blue_layer_rect1, blue_paint); |
2587 recording->add_draw_rect_with_paint(blue_layer_rect2, blue_paint); | 2587 recording->add_draw_rect_with_paint(blue_layer_rect2, blue_paint); |
2588 recording->RerecordPile(); | 2588 recording->Rerecord(); |
2589 scoped_refptr<FakePicturePileImpl> pile = | 2589 scoped_refptr<FakePicturePileImpl> pile = |
2590 FakePicturePileImpl::CreateFromPile(recording.get(), nullptr); | 2590 FakePicturePileImpl::CreateFromPile(recording.get(), nullptr); |
2591 | 2591 |
2592 gfx::Rect content_rect( | 2592 gfx::Rect content_rect( |
2593 gfx::ScaleToEnclosingRect(layer_rect, contents_scale)); | 2593 gfx::ScaleToEnclosingRect(layer_rect, contents_scale)); |
2594 gfx::Rect content_union_rect( | 2594 gfx::Rect content_union_rect( |
2595 gfx::ToEnclosingRect(gfx::ScaleRect(union_layer_rect, contents_scale))); | 2595 gfx::ToEnclosingRect(gfx::ScaleRect(union_layer_rect, contents_scale))); |
2596 | 2596 |
2597 // At a scale of 4x the rectangles with a width of 2.5 will take up 10 pixels, | 2597 // At a scale of 4x the rectangles with a width of 2.5 will take up 10 pixels, |
2598 // so scale an additional 10x to make them 100x100. | 2598 // so scale an additional 10x to make them 100x100. |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 ? FILE_PATH_LITERAL("four_blue_green_checkers.png") | 2939 ? FILE_PATH_LITERAL("four_blue_green_checkers.png") |
2940 : FILE_PATH_LITERAL("checkers_big.png"); | 2940 : FILE_PATH_LITERAL("checkers_big.png"); |
2941 EXPECT_TRUE(this->RunPixelTest(&pass_list, base::FilePath(path), | 2941 EXPECT_TRUE(this->RunPixelTest(&pass_list, base::FilePath(path), |
2942 ExactPixelComparator(true))); | 2942 ExactPixelComparator(true))); |
2943 } | 2943 } |
2944 | 2944 |
2945 #endif // !defined(OS_ANDROID) | 2945 #endif // !defined(OS_ANDROID) |
2946 | 2946 |
2947 } // namespace | 2947 } // namespace |
2948 } // namespace cc | 2948 } // namespace cc |
OLD | NEW |