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

Side by Side Diff: cc/output/gl_renderer_unittest.cc

Issue 2780073002: Disable DirectComposition underlays and complex transforms by default. (Closed)
Patch Set: fix tests Created 3 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 | « cc/output/dc_layer_overlay.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/test/scoped_feature_list.h"
14 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
15 #include "cc/base/math_util.h" 16 #include "cc/base/math_util.h"
16 #include "cc/output/copy_output_request.h" 17 #include "cc/output/copy_output_request.h"
17 #include "cc/output/copy_output_result.h" 18 #include "cc/output/copy_output_result.h"
18 #include "cc/output/overlay_strategy_single_on_top.h" 19 #include "cc/output/overlay_strategy_single_on_top.h"
19 #include "cc/output/overlay_strategy_underlay.h" 20 #include "cc/output/overlay_strategy_underlay.h"
20 #include "cc/output/texture_mailbox_deleter.h" 21 #include "cc/output/texture_mailbox_deleter.h"
21 #include "cc/quads/texture_draw_quad.h" 22 #include "cc/quads/texture_draw_quad.h"
22 #include "cc/resources/resource_provider.h" 23 #include "cc/resources/resource_provider.h"
23 #include "cc/test/fake_impl_task_runner_provider.h" 24 #include "cc/test/fake_impl_task_runner_provider.h"
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 public: 2025 public:
2025 void GetStrategies(OverlayProcessor::StrategyList* strategies) override {} 2026 void GetStrategies(OverlayProcessor::StrategyList* strategies) override {}
2026 bool AllowCALayerOverlays() override { return false; } 2027 bool AllowCALayerOverlays() override { return false; }
2027 bool AllowDCLayerOverlays() override { return true; } 2028 bool AllowDCLayerOverlays() override { return true; }
2028 void CheckOverlaySupport(OverlayCandidateList* surfaces) override {} 2029 void CheckOverlaySupport(OverlayCandidateList* surfaces) override {}
2029 }; 2030 };
2030 2031
2031 // Test that SetEnableDCLayersCHROMIUM is properly called when enabling 2032 // Test that SetEnableDCLayersCHROMIUM is properly called when enabling
2032 // and disabling DC layers. 2033 // and disabling DC layers.
2033 TEST_F(GLRendererTest, DCLayerOverlaySwitch) { 2034 TEST_F(GLRendererTest, DCLayerOverlaySwitch) {
2035 base::test::ScopedFeatureList feature_list;
2036 feature_list.InitAndEnableFeature(features::kDirectCompositionUnderlays);
2034 auto gl_owned = base::MakeUnique<PartialSwapMockGLES2Interface>(true); 2037 auto gl_owned = base::MakeUnique<PartialSwapMockGLES2Interface>(true);
2035 auto* gl = gl_owned.get(); 2038 auto* gl = gl_owned.get();
2036 2039
2037 auto provider = TestContextProvider::Create(std::move(gl_owned)); 2040 auto provider = TestContextProvider::Create(std::move(gl_owned));
2038 provider->BindToCurrentThread(); 2041 provider->BindToCurrentThread();
2039 2042
2040 FakeOutputSurfaceClient output_surface_client; 2043 FakeOutputSurfaceClient output_surface_client;
2041 std::unique_ptr<FakeOutputSurface> output_surface( 2044 std::unique_ptr<FakeOutputSurface> output_surface(
2042 FakeOutputSurface::Create3d(std::move(provider))); 2045 FakeOutputSurface::Create3d(std::move(provider)));
2043 output_surface->BindToClient(&output_surface_client); 2046 output_surface->BindToClient(&output_surface_client);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2256 2259
2257 TEST_F(GLRendererSwapWithBoundsTest, NonEmpty) { 2260 TEST_F(GLRendererSwapWithBoundsTest, NonEmpty) {
2258 std::vector<gfx::Rect> content_bounds; 2261 std::vector<gfx::Rect> content_bounds;
2259 content_bounds.push_back(gfx::Rect(0, 0, 10, 10)); 2262 content_bounds.push_back(gfx::Rect(0, 0, 10, 10));
2260 content_bounds.push_back(gfx::Rect(20, 20, 30, 30)); 2263 content_bounds.push_back(gfx::Rect(20, 20, 30, 30));
2261 RunTest(content_bounds); 2264 RunTest(content_bounds);
2262 } 2265 }
2263 2266
2264 } // namespace 2267 } // namespace
2265 } // namespace cc 2268 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/dc_layer_overlay.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698