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

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

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/ui_resource_layer_impl.h" 6 #include "cc/layers/ui_resource_layer_impl.h"
7 #include "cc/quads/draw_quad.h" 7 #include "cc/quads/draw_quad.h"
8 #include "cc/resources/ui_resource_bitmap.h" 8 #include "cc/resources/ui_resource_bitmap.h"
9 #include "cc/resources/ui_resource_client.h" 9 #include "cc/resources/ui_resource_client.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 14 matching lines...) Expand all
25 const gfx::Size& bitmap_size, 25 const gfx::Size& bitmap_size,
26 const gfx::Size& layer_size, 26 const gfx::Size& layer_size,
27 bool opaque, 27 bool opaque,
28 UIResourceId uid) { 28 UIResourceId uid) {
29 gfx::Rect visible_content_rect(layer_size); 29 gfx::Rect visible_content_rect(layer_size);
30 scoped_ptr<UIResourceLayerImpl> layer = 30 scoped_ptr<UIResourceLayerImpl> layer =
31 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); 31 UIResourceLayerImpl::Create(host_impl->active_tree(), 1);
32 layer->draw_properties().visible_content_rect = visible_content_rect; 32 layer->draw_properties().visible_content_rect = visible_content_rect;
33 layer->SetBounds(layer_size); 33 layer->SetBounds(layer_size);
34 layer->SetContentBounds(layer_size); 34 layer->SetContentBounds(layer_size);
35 layer->CreateRenderSurface(); 35 layer->SetHasRenderSurface(true);
36 layer->draw_properties().render_target = layer.get(); 36 layer->draw_properties().render_target = layer.get();
37 37
38 UIResourceBitmap bitmap(bitmap_size, opaque); 38 UIResourceBitmap bitmap(bitmap_size, opaque);
39 39
40 host_impl->CreateUIResource(uid, bitmap); 40 host_impl->CreateUIResource(uid, bitmap);
41 layer->SetUIResourceId(uid); 41 layer->SetUIResourceId(uid);
42 42
43 return layer.Pass(); 43 return layer.Pass();
44 } 44 }
45 45
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 occluded, 201 occluded,
202 &partially_occluded_count); 202 &partially_occluded_count);
203 // The layer outputs one quad, which is partially occluded. 203 // The layer outputs one quad, which is partially occluded.
204 EXPECT_EQ(1u, impl.quad_list().size()); 204 EXPECT_EQ(1u, impl.quad_list().size());
205 EXPECT_EQ(1u, partially_occluded_count); 205 EXPECT_EQ(1u, partially_occluded_count);
206 } 206 }
207 } 207 }
208 208
209 } // namespace 209 } // namespace
210 } // namespace cc 210 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698