| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/mac/sdk_forward_declarations.h" | 7 #include "base/mac/sdk_forward_declarations.h" |
| 8 #include "gpu/GLES2/gl2extchromium.h" | 8 #include "gpu/GLES2/gl2extchromium.h" |
| 9 #include "gpu/ipc/service/ca_layer_tree_mac.h" | 9 #include "gpu/ipc/service/ca_layer_tree_mac.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "ui/gfx/geometry/dip_util.h" | 12 #include "ui/gfx/geometry/dip_util.h" |
| 13 #include "ui/gfx/mac/io_surface.h" | 13 #include "ui/gfx/mac/io_surface.h" |
| 14 | 14 |
| 15 namespace gpu { | 15 namespace gpu { |
| 16 | 16 |
| 17 class CALayerTreeTest : public testing::Test { | 17 class CALayerTreeTest : public testing::Test { |
| 18 protected: | 18 protected: |
| 19 void SetUp() override { | 19 void SetUp() override { |
| 20 superlayer_.reset([[CALayer alloc] init]); | 20 superlayer_.reset([[CALayer alloc] init]); |
| 21 } | 21 } |
| 22 | 22 |
| 23 base::scoped_nsobject<CALayer> superlayer_; | 23 base::scoped_nsobject<CALayer> superlayer_; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // Test updating each layer's properties. | 26 // Test updating each layer's properties. |
| 27 TEST_F(CALayerTreeTest, PropertyUpdates) { | 27 TEST_F(CALayerTreeTest, PropertyUpdates) { |
| 28 // Are we running this anymore?? |
| 29 EXPECT_TRUE(false); |
| 30 |
| 28 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(gfx::CreateIOSurface( | 31 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(gfx::CreateIOSurface( |
| 29 gfx::Size(256, 256), gfx::BufferFormat::BGRA_8888)); | 32 gfx::Size(256, 256), gfx::BufferFormat::BGRA_8888)); |
| 30 bool is_clipped = true; | 33 bool is_clipped = true; |
| 31 gfx::Rect clip_rect(2, 4, 8, 16); | 34 gfx::Rect clip_rect(2, 4, 8, 16); |
| 32 int sorting_context_id = 0; | 35 int sorting_context_id = 0; |
| 33 gfx::Transform transform; | 36 gfx::Transform transform; |
| 34 transform.Translate(10, 20); | 37 transform.Translate(10, 20); |
| 35 gfx::RectF contents_rect(0.0f, 0.25f, 0.5f, 0.75f); | 38 gfx::RectF contents_rect(0.0f, 0.25f, 0.5f, 0.75f); |
| 36 gfx::Rect rect(16, 32, 64, 128); | 39 gfx::Rect rect(16, 32, 64, 128); |
| 37 unsigned background_color = SkColorSetARGB(0xFF, 0xFF, 0, 0); | 40 unsigned background_color = SkColorSetARGB(0xFF, 0xFF, 0, 0); |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 content_layer3 = [[transform_layer sublayers] objectAtIndex:0]; | 848 content_layer3 = [[transform_layer sublayers] objectAtIndex:0]; |
| 846 | 849 |
| 847 // Validate the content layer. | 850 // Validate the content layer. |
| 848 EXPECT_FALSE([content_layer3 | 851 EXPECT_FALSE([content_layer3 |
| 849 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]); | 852 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]); |
| 850 EXPECT_EQ(content_layer3, content_layer2); | 853 EXPECT_EQ(content_layer3, content_layer2); |
| 851 } | 854 } |
| 852 } | 855 } |
| 853 | 856 |
| 854 } // namespace gpu | 857 } // namespace gpu |
| OLD | NEW |