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

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

Issue 1491033002: Create RenderSurface on Effect Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alwayspt
Patch Set: fix for crash Created 5 years 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/layers/layer_iterator_unittest.cc ('k') | cc/layers/picture_layer_impl_perftest.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 "base/containers/hash_tables.h" 5 #include "base/containers/hash_tables.h"
6 #include "cc/layers/append_quads_data.h" 6 #include "cc/layers/append_quads_data.h"
7 #include "cc/layers/nine_patch_layer_impl.h" 7 #include "cc/layers/nine_patch_layer_impl.h"
8 #include "cc/quads/texture_draw_quad.h" 8 #include "cc/quads/texture_draw_quad.h"
9 #include "cc/resources/ui_resource_bitmap.h" 9 #include "cc/resources/ui_resource_bitmap.h"
10 #include "cc/resources/ui_resource_client.h" 10 #include "cc/resources/ui_resource_client.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); 49 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
50 FakeUIResourceLayerTreeHostImpl host_impl( 50 FakeUIResourceLayerTreeHostImpl host_impl(
51 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); 51 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner);
52 host_impl.SetVisible(true); 52 host_impl.SetVisible(true);
53 host_impl.InitializeRenderer(output_surface.get()); 53 host_impl.InitializeRenderer(output_surface.get());
54 54
55 scoped_ptr<NinePatchLayerImpl> layer = 55 scoped_ptr<NinePatchLayerImpl> layer =
56 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); 56 NinePatchLayerImpl::Create(host_impl.active_tree(), 1);
57 layer->draw_properties().visible_layer_rect = visible_layer_rect; 57 layer->draw_properties().visible_layer_rect = visible_layer_rect;
58 layer->SetBounds(layer_size); 58 layer->SetBounds(layer_size);
59 layer->SetHasRenderSurface(true); 59 layer->SetForceRenderSurface(true);
60 layer->draw_properties().render_target = layer.get(); 60 layer->draw_properties().render_target = layer.get();
61 61
62 UIResourceId uid = 1; 62 UIResourceId uid = 1;
63 bool is_opaque = false; 63 bool is_opaque = false;
64 UIResourceBitmap bitmap(bitmap_size, is_opaque); 64 UIResourceBitmap bitmap(bitmap_size, is_opaque);
65 65
66 host_impl.CreateUIResource(uid, bitmap); 66 host_impl.CreateUIResource(uid, bitmap);
67 layer->SetUIResourceId(uid); 67 layer->SetUIResourceId(uid);
68 layer->SetImageBounds(bitmap_size); 68 layer->SetImageBounds(bitmap_size);
69 layer->SetLayout(aperture_rect, border, fill_center); 69 layer->SetLayout(aperture_rect, border, fill_center);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 const QuadList &quad_list = impl.quad_list(); 336 const QuadList &quad_list = impl.quad_list();
337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); 337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin();
338 it != quad_list.BackToFrontEnd(); ++it) 338 it != quad_list.BackToFrontEnd(); ++it)
339 EXPECT_TRUE(it->ShouldDrawWithBlending()); 339 EXPECT_TRUE(it->ShouldDrawWithBlending());
340 } 340 }
341 } 341 }
342 342
343 } // namespace 343 } // namespace
344 } // namespace cc 344 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_iterator_unittest.cc ('k') | cc/layers/picture_layer_impl_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698