OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/graphics/paint/GeometryMapper.h" | 5 #include "platform/graphics/paint/GeometryMapper.h" |
6 | 6 |
7 #include "platform/geometry/GeometryTestHelpers.h" | 7 #include "platform/geometry/GeometryTestHelpers.h" |
8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "platform/graphics/BoxReflection.h" | 9 #include "platform/graphics/BoxReflection.h" |
10 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" | 10 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 RefPtr<ClipPaintPropertyNode> clip = ClipPaintPropertyNode::create( | 358 RefPtr<ClipPaintPropertyNode> clip = ClipPaintPropertyNode::create( |
359 ClipPaintPropertyNode::root(), TransformPaintPropertyNode::root(), rect); | 359 ClipPaintPropertyNode::root(), TransformPaintPropertyNode::root(), rect); |
360 | 360 |
361 PropertyTreeState localState = rootPropertyTreeState(); | 361 PropertyTreeState localState = rootPropertyTreeState(); |
362 localState.setClip(clip.get()); | 362 localState.setClip(clip.get()); |
363 | 363 |
364 FloatRect input(0, 0, 100, 100); | 364 FloatRect input(0, 0, 100, 100); |
365 FloatRect output(10, 10, 50, 50); | 365 FloatRect output(10, 10, 50, 50); |
366 | 366 |
367 FloatClipRect expectedClip(clip->clipRect().rect()); | 367 FloatClipRect expectedClip(clip->clipRect().rect()); |
368 expectedClip.setHasRadius(true); | 368 expectedClip.setHasRadius(); |
369 | 369 |
370 bool hasRadius = true; | 370 bool hasRadius = true; |
371 CHECK_MAPPINGS(input, // Input | 371 CHECK_MAPPINGS(input, // Input |
372 output, // Visual rect | 372 output, // Visual rect |
373 input, // Transformed rect (not clipped). | 373 input, // Transformed rect (not clipped). |
374 TransformPaintPropertyNode::root() | 374 TransformPaintPropertyNode::root() |
375 ->matrix(), // Transform matrix to ancestor space | 375 ->matrix(), // Transform matrix to ancestor space |
376 expectedClip, // Clip rect in ancestor space | 376 expectedClip, // Clip rect in ancestor space |
377 localState, | 377 localState, |
378 rootPropertyTreeState(), hasRadius); | 378 rootPropertyTreeState(), hasRadius); |
(...skipping 14 matching lines...) Expand all Loading... |
393 FloatRoundedRect(10, 10, 50, 50)); | 393 FloatRoundedRect(10, 10, 50, 50)); |
394 | 394 |
395 PropertyTreeState localState = rootPropertyTreeState(); | 395 PropertyTreeState localState = rootPropertyTreeState(); |
396 PropertyTreeState ancestorState = rootPropertyTreeState(); | 396 PropertyTreeState ancestorState = rootPropertyTreeState(); |
397 localState.setClip(clip2.get()); | 397 localState.setClip(clip2.get()); |
398 | 398 |
399 FloatRect input(0, 0, 100, 100); | 399 FloatRect input(0, 0, 100, 100); |
400 FloatRect output1(10, 10, 30, 40); | 400 FloatRect output1(10, 10, 30, 40); |
401 | 401 |
402 FloatClipRect clipRect(clip1->clipRect().rect()); | 402 FloatClipRect clipRect(clip1->clipRect().rect()); |
403 clipRect.setHasRadius(true); | 403 clipRect.setHasRadius(); |
404 | 404 |
405 bool hasRadius = true; | 405 bool hasRadius = true; |
406 CHECK_MAPPINGS(input, // Input | 406 CHECK_MAPPINGS(input, // Input |
407 output1, // Visual rect | 407 output1, // Visual rect |
408 input, // Transformed rect (not clipped). | 408 input, // Transformed rect (not clipped). |
409 TransformPaintPropertyNode::root() | 409 TransformPaintPropertyNode::root() |
410 ->matrix(), // Transform matrix to ancestor space | 410 ->matrix(), // Transform matrix to ancestor space |
411 clipRect, // Clip rect in ancestor space | 411 clipRect, // Clip rect in ancestor space |
412 localState, | 412 localState, |
413 ancestorState, hasRadius); | 413 ancestorState, hasRadius); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 clip1, transform.get(), FloatRoundedRect(10, 10, 30, 40)); | 446 clip1, transform.get(), FloatRoundedRect(10, 10, 30, 40)); |
447 | 447 |
448 PropertyTreeState localState = rootPropertyTreeState(); | 448 PropertyTreeState localState = rootPropertyTreeState(); |
449 PropertyTreeState ancestorState = rootPropertyTreeState(); | 449 PropertyTreeState ancestorState = rootPropertyTreeState(); |
450 localState.setClip(clip2.get()); | 450 localState.setClip(clip2.get()); |
451 | 451 |
452 FloatRect input(0, 0, 100, 100); | 452 FloatRect input(0, 0, 100, 100); |
453 FloatRect output1(10, 10, 30, 40); | 453 FloatRect output1(10, 10, 30, 40); |
454 | 454 |
455 FloatClipRect expectedClip(clip2->clipRect().rect()); | 455 FloatClipRect expectedClip(clip2->clipRect().rect()); |
456 expectedClip.setHasRadius(true); | 456 expectedClip.setHasRadius(); |
457 | 457 |
458 bool hasRadius = true; | 458 bool hasRadius = true; |
459 CHECK_MAPPINGS(input, // Input | 459 CHECK_MAPPINGS(input, // Input |
460 output1, // Visual rect | 460 output1, // Visual rect |
461 input, // Transformed rect (not clipped). | 461 input, // Transformed rect (not clipped). |
462 TransformPaintPropertyNode::root() | 462 TransformPaintPropertyNode::root() |
463 ->matrix(), // Transform matrix to ancestor space | 463 ->matrix(), // Transform matrix to ancestor space |
464 expectedClip, // Clip rect in ancestor space | 464 expectedClip, // Clip rect in ancestor space |
465 localState, | 465 localState, |
466 ancestorState, hasRadius); | 466 ancestorState, hasRadius); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 FloatRect input(100, 100, 50, 50); | 829 FloatRect input(100, 100, 50, 50); |
830 // Reflection is at (50, 100, 50, 50). | 830 // Reflection is at (50, 100, 50, 50). |
831 FloatRect output(50, 100, 100, 50); | 831 FloatRect output(50, 100, 100, 50); |
832 | 832 |
833 bool hasRadius = false; | 833 bool hasRadius = false; |
834 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(), | 834 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(), |
835 localState, rootPropertyTreeState(), hasRadius); | 835 localState, rootPropertyTreeState(), hasRadius); |
836 } | 836 } |
837 | 837 |
838 } // namespace blink | 838 } // namespace blink |
OLD | NEW |