OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/frame/FrameView.h" | 5 #include "core/frame/FrameView.h" |
6 #include "core/layout/api/LayoutViewItem.h" | 6 #include "core/layout/api/LayoutViewItem.h" |
7 #include "core/layout/compositing/CompositedLayerMapping.h" | 7 #include "core/layout/compositing/CompositedLayerMapping.h" |
8 #include "core/layout/compositing/PaintLayerCompositor.h" | 8 #include "core/layout/compositing/PaintLayerCompositor.h" |
9 #include "core/page/Page.h" | 9 #include "core/page/Page.h" |
10 #include "platform/graphics/CompositorMutableProperties.h" | 10 #include "platform/graphics/CompositorMutableProperties.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 EXPECT_TRUE(proxiedLayer->compositorMutableProperties() & | 319 EXPECT_TRUE(proxiedLayer->compositorMutableProperties() & |
320 CompositorMutableProperty::kOpacity); | 320 CompositorMutableProperty::kOpacity); |
321 EXPECT_FALSE(proxiedLayer->compositorMutableProperties() & | 321 EXPECT_FALSE(proxiedLayer->compositorMutableProperties() & |
322 (CompositorMutableProperty::kScrollLeft | | 322 (CompositorMutableProperty::kScrollLeft | |
323 CompositorMutableProperty::kScrollTop)); | 323 CompositorMutableProperty::kScrollTop)); |
324 EXPECT_TRUE(proxiedLayer->elementId()); | 324 EXPECT_TRUE(proxiedLayer->elementId()); |
325 | 325 |
326 TransformationMatrix transformMatrix(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, | 326 TransformationMatrix transformMatrix(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, |
327 33, 34, 41, 42, 43, 44); | 327 33, 34, 41, 42, 43, 44); |
328 std::unique_ptr<CompositorMutation> mutation = | 328 std::unique_ptr<CompositorMutation> mutation = |
329 wrapUnique(new CompositorMutation); | 329 WTF::wrapUnique(new CompositorMutation); |
330 mutation->setTransform(TransformationMatrix::toSkMatrix44(transformMatrix)); | 330 mutation->setTransform(TransformationMatrix::toSkMatrix44(transformMatrix)); |
331 mutation->setOpacity(0.5); | 331 mutation->setOpacity(0.5); |
332 | 332 |
333 proxiedElement->updateFromCompositorMutation(*mutation); | 333 proxiedElement->updateFromCompositorMutation(*mutation); |
334 { | 334 { |
335 const String& transformValue = | 335 const String& transformValue = |
336 document->domWindow() | 336 document->domWindow() |
337 ->getComputedStyle(proxiedElement, String()) | 337 ->getComputedStyle(proxiedElement, String()) |
338 ->getPropertyValueInternal(CSSPropertyTransform); | 338 ->getPropertyValueInternal(CSSPropertyTransform); |
339 EXPECT_EQ( | 339 EXPECT_EQ( |
340 "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, " | 340 "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, " |
341 "44)", | 341 "44)", |
342 transformValue); | 342 transformValue); |
343 | 343 |
344 const String& opacityValue = | 344 const String& opacityValue = |
345 document->domWindow() | 345 document->domWindow() |
346 ->getComputedStyle(proxiedElement, String()) | 346 ->getComputedStyle(proxiedElement, String()) |
347 ->getPropertyValueInternal(CSSPropertyOpacity); | 347 ->getPropertyValueInternal(CSSPropertyOpacity); |
348 EXPECT_EQ("0.5", opacityValue); | 348 EXPECT_EQ("0.5", opacityValue); |
349 } | 349 } |
350 | 350 |
351 // Verify that updating one property does not impact others | 351 // Verify that updating one property does not impact others |
352 mutation = wrapUnique(new CompositorMutation); | 352 mutation = WTF::wrapUnique(new CompositorMutation); |
353 mutation->setOpacity(0.8); | 353 mutation->setOpacity(0.8); |
354 | 354 |
355 proxiedElement->updateFromCompositorMutation(*mutation); | 355 proxiedElement->updateFromCompositorMutation(*mutation); |
356 { | 356 { |
357 const String& transformValue = | 357 const String& transformValue = |
358 document->domWindow() | 358 document->domWindow() |
359 ->getComputedStyle(proxiedElement, String()) | 359 ->getComputedStyle(proxiedElement, String()) |
360 ->getPropertyValueInternal(CSSPropertyTransform); | 360 ->getPropertyValueInternal(CSSPropertyTransform); |
361 EXPECT_EQ( | 361 EXPECT_EQ( |
362 "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, " | 362 "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, " |
363 "44)", | 363 "44)", |
364 transformValue); | 364 transformValue); |
365 | 365 |
366 const String& opacityValue = | 366 const String& opacityValue = |
367 document->domWindow() | 367 document->domWindow() |
368 ->getComputedStyle(proxiedElement, String()) | 368 ->getComputedStyle(proxiedElement, String()) |
369 ->getPropertyValueInternal(CSSPropertyOpacity); | 369 ->getPropertyValueInternal(CSSPropertyOpacity); |
370 EXPECT_EQ("0.8", opacityValue); | 370 EXPECT_EQ("0.8", opacityValue); |
371 } | 371 } |
372 } | 372 } |
373 | 373 |
374 } // namespace blink | 374 } // namespace blink |
OLD | NEW |