Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: content/common/gpu/ca_layer_tree_unittest_mac.mm

Issue 1846913007: Mac: Disable use of AVSampleBufferDisplayLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: https Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/gpu/ca_layer_tree_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/mac/sdk_forward_declarations.h" 5 #include "base/mac/sdk_forward_declarations.h"
6 #include "content/common/gpu/ca_layer_tree_mac.h" 6 #include "content/common/gpu/ca_layer_tree_mac.h"
7 #include "gpu/GLES2/gl2extchromium.h" 7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/gfx/geometry/dip_util.h" 10 #include "ui/gfx/geometry/dip_util.h"
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 EXPECT_EQ(1u, [[superlayer_ sublayers] count]); 776 EXPECT_EQ(1u, [[superlayer_ sublayers] count]);
777 root_layer = [[superlayer_ sublayers] objectAtIndex:0]; 777 root_layer = [[superlayer_ sublayers] objectAtIndex:0];
778 EXPECT_EQ(1u, [[root_layer sublayers] count]); 778 EXPECT_EQ(1u, [[root_layer sublayers] count]);
779 clip_and_sorting_layer = [[root_layer sublayers] objectAtIndex:0]; 779 clip_and_sorting_layer = [[root_layer sublayers] objectAtIndex:0];
780 EXPECT_EQ(1u, [[clip_and_sorting_layer sublayers] count]); 780 EXPECT_EQ(1u, [[clip_and_sorting_layer sublayers] count]);
781 transform_layer = [[clip_and_sorting_layer sublayers] objectAtIndex:0]; 781 transform_layer = [[clip_and_sorting_layer sublayers] objectAtIndex:0];
782 EXPECT_EQ(1u, [[transform_layer sublayers] count]); 782 EXPECT_EQ(1u, [[transform_layer sublayers] count]);
783 content_layer1 = [[transform_layer sublayers] objectAtIndex:0]; 783 content_layer1 = [[transform_layer sublayers] objectAtIndex:0];
784 784
785 // Validate the content layer. 785 // Validate the content layer.
786 EXPECT_TRUE([content_layer1 786 EXPECT_FALSE([content_layer1
787 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]); 787 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]);
788 } 788 }
789 789
790 io_surface.reset(gfx::CreateIOSurface(gfx::Size(256, 256), 790 io_surface.reset(gfx::CreateIOSurface(gfx::Size(256, 256),
791 gfx::BufferFormat::YUV_420_BIPLANAR)); 791 gfx::BufferFormat::YUV_420_BIPLANAR));
792 792
793 // Pass another frame. 793 // Pass another frame.
794 { 794 {
795 scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); 795 scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
796 result = new_ca_layer_tree->ScheduleCALayer( 796 result = new_ca_layer_tree->ScheduleCALayer(
797 is_clipped, clip_rect, sorting_context_id, transform, io_surface, 797 is_clipped, clip_rect, sorting_context_id, transform, io_surface,
798 contents_rect, rect, background_color, edge_aa_mask, opacity); 798 contents_rect, rect, background_color, edge_aa_mask, opacity);
799 EXPECT_TRUE(result); 799 EXPECT_TRUE(result);
800 new_ca_layer_tree->CommitScheduledCALayers( 800 new_ca_layer_tree->CommitScheduledCALayers(
801 superlayer_, std::move(ca_layer_tree), scale_factor); 801 superlayer_, std::move(ca_layer_tree), scale_factor);
802 std::swap(new_ca_layer_tree, ca_layer_tree); 802 std::swap(new_ca_layer_tree, ca_layer_tree);
803 803
804 // Validate the tree structure. 804 // Validate the tree structure.
805 EXPECT_EQ(1u, [[superlayer_ sublayers] count]); 805 EXPECT_EQ(1u, [[superlayer_ sublayers] count]);
806 root_layer = [[superlayer_ sublayers] objectAtIndex:0]; 806 root_layer = [[superlayer_ sublayers] objectAtIndex:0];
807 EXPECT_EQ(1u, [[root_layer sublayers] count]); 807 EXPECT_EQ(1u, [[root_layer sublayers] count]);
808 clip_and_sorting_layer = [[root_layer sublayers] objectAtIndex:0]; 808 clip_and_sorting_layer = [[root_layer sublayers] objectAtIndex:0];
809 EXPECT_EQ(1u, [[clip_and_sorting_layer sublayers] count]); 809 EXPECT_EQ(1u, [[clip_and_sorting_layer sublayers] count]);
810 transform_layer = [[clip_and_sorting_layer sublayers] objectAtIndex:0]; 810 transform_layer = [[clip_and_sorting_layer sublayers] objectAtIndex:0];
811 EXPECT_EQ(1u, [[transform_layer sublayers] count]); 811 EXPECT_EQ(1u, [[transform_layer sublayers] count]);
812 content_layer2 = [[transform_layer sublayers] objectAtIndex:0]; 812 content_layer2 = [[transform_layer sublayers] objectAtIndex:0];
813 813
814 // Validate the content layer. 814 // Validate the content layer.
815 EXPECT_TRUE([content_layer2 815 EXPECT_FALSE([content_layer2
816 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]); 816 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]);
817 EXPECT_EQ(content_layer2, content_layer1); 817 EXPECT_EQ(content_layer2, content_layer1);
818 } 818 }
819 819
820 io_surface.reset(gfx::CreateIOSurface(gfx::Size(256, 256), 820 io_surface.reset(gfx::CreateIOSurface(gfx::Size(256, 256),
821 gfx::BufferFormat::YUV_420_BIPLANAR)); 821 gfx::BufferFormat::YUV_420_BIPLANAR));
822 822
823 // Pass a frame that is clipped. 823 // Pass a frame that is clipped.
824 contents_rect = gfx::RectF(0, 0, 1, 0.9); 824 contents_rect = gfx::RectF(0, 0, 1, 0.9);
825 { 825 {
(...skipping 12 matching lines...) Expand all
838 EXPECT_EQ(1u, [[root_layer sublayers] count]); 838 EXPECT_EQ(1u, [[root_layer sublayers] count]);
839 clip_and_sorting_layer = [[root_layer sublayers] objectAtIndex:0]; 839 clip_and_sorting_layer = [[root_layer sublayers] objectAtIndex:0];
840 EXPECT_EQ(1u, [[clip_and_sorting_layer sublayers] count]); 840 EXPECT_EQ(1u, [[clip_and_sorting_layer sublayers] count]);
841 transform_layer = [[clip_and_sorting_layer sublayers] objectAtIndex:0]; 841 transform_layer = [[clip_and_sorting_layer sublayers] objectAtIndex:0];
842 EXPECT_EQ(1u, [[transform_layer sublayers] count]); 842 EXPECT_EQ(1u, [[transform_layer sublayers] count]);
843 content_layer3 = [[transform_layer sublayers] objectAtIndex:0]; 843 content_layer3 = [[transform_layer sublayers] objectAtIndex:0];
844 844
845 // Validate the content layer. 845 // Validate the content layer.
846 EXPECT_FALSE([content_layer3 846 EXPECT_FALSE([content_layer3
847 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]); 847 isKindOfClass:NSClassFromString(@"AVSampleBufferDisplayLayer")]);
848 EXPECT_NE(content_layer3, content_layer2); 848 EXPECT_EQ(content_layer3, content_layer2);
849 } 849 }
850 } 850 }
851 851
852 } // namespace content 852 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/ca_layer_tree_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698