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

Side by Side Diff: cc/layers/nine_patch_layer_impl_unittest.cc

Issue 2171143002: cc: Get rid of non-delegated rendering in most cc unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@killdirecttests
Patch Set: fakeoutputsurface: cc-blink-tests Created 4 years, 5 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/nine_patch_layer_impl.h" 8 #include "cc/layers/nine_patch_layer_impl.h"
9 #include "cc/quads/texture_draw_quad.h" 9 #include "cc/quads/texture_draw_quad.h"
10 #include "cc/resources/ui_resource_bitmap.h" 10 #include "cc/resources/ui_resource_bitmap.h"
(...skipping 29 matching lines...) Expand all
40 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 40 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
41 gfx::Rect visible_layer_rect(layer_size); 41 gfx::Rect visible_layer_rect(layer_size);
42 gfx::Rect expected_remaining(border.x(), 42 gfx::Rect expected_remaining(border.x(),
43 border.y(), 43 border.y(),
44 layer_size.width() - border.width(), 44 layer_size.width() - border.width(),
45 layer_size.height() - border.height()); 45 layer_size.height() - border.height());
46 46
47 FakeImplTaskRunnerProvider task_runner_provider; 47 FakeImplTaskRunnerProvider task_runner_provider;
48 TestSharedBitmapManager shared_bitmap_manager; 48 TestSharedBitmapManager shared_bitmap_manager;
49 TestTaskGraphRunner task_graph_runner; 49 TestTaskGraphRunner task_graph_runner;
50 std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); 50 std::unique_ptr<OutputSurface> output_surface =
51 FakeOutputSurface::CreateDelegating3d();
51 FakeUIResourceLayerTreeHostImpl host_impl( 52 FakeUIResourceLayerTreeHostImpl host_impl(
52 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); 53 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner);
53 host_impl.SetVisible(true); 54 host_impl.SetVisible(true);
54 host_impl.InitializeRenderer(output_surface.get()); 55 host_impl.InitializeRenderer(output_surface.get());
55 56
56 std::unique_ptr<NinePatchLayerImpl> layer = 57 std::unique_ptr<NinePatchLayerImpl> layer =
57 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); 58 NinePatchLayerImpl::Create(host_impl.active_tree(), 1);
58 layer->draw_properties().visible_layer_rect = visible_layer_rect; 59 layer->draw_properties().visible_layer_rect = visible_layer_rect;
59 layer->SetBounds(layer_size); 60 layer->SetBounds(layer_size);
60 layer->test_properties()->force_render_surface = true; 61 layer->test_properties()->force_render_surface = true;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 336
336 const QuadList &quad_list = impl.quad_list(); 337 const QuadList &quad_list = impl.quad_list();
337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); 338 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin();
338 it != quad_list.BackToFrontEnd(); ++it) 339 it != quad_list.BackToFrontEnd(); ++it)
339 EXPECT_TRUE(it->ShouldDrawWithBlending()); 340 EXPECT_TRUE(it->ShouldDrawWithBlending());
340 } 341 }
341 } 342 }
342 343
343 } // namespace 344 } // namespace
344 } // namespace cc 345 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698