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

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

Issue 2322943003: cc: Move UI Resource management out of LayerTreeHost. (Closed)
Patch Set: virtual dtor Created 4 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
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/painted_scrollbar_layer.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/layers/nine_patch_layer.h" 5 #include "cc/layers/nine_patch_layer.h"
6 6
7 #include "cc/resources/resource_provider.h" 7 #include "cc/resources/resource_provider.h"
8 #include "cc/resources/scoped_ui_resource.h" 8 #include "cc/resources/scoped_ui_resource.h"
9 #include "cc/test/fake_layer_tree_host.h" 9 #include "cc/test/fake_layer_tree_host.h"
10 #include "cc/test/fake_layer_tree_host_client.h" 10 #include "cc/test/fake_layer_tree_host_client.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 52 Mock::VerifyAndClearExpectations(layer_tree_host_.get());
53 EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); 53 EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get());
54 54
55 gfx::Rect screen_space_clip_rect; 55 gfx::Rect screen_space_clip_rect;
56 test_layer->SavePaintProperties(); 56 test_layer->SavePaintProperties();
57 test_layer->Update(); 57 test_layer->Update();
58 58
59 EXPECT_FALSE(test_layer->DrawsContent()); 59 EXPECT_FALSE(test_layer->DrawsContent());
60 60
61 bool is_opaque = false; 61 bool is_opaque = false;
62 std::unique_ptr<ScopedUIResource> resource = ScopedUIResource::Create( 62 std::unique_ptr<ScopedUIResource> resource =
63 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); 63 ScopedUIResource::Create(layer_tree_host_->GetUIResourceManager(),
64 UIResourceBitmap(gfx::Size(10, 10), is_opaque));
64 gfx::Rect aperture(5, 5, 1, 1); 65 gfx::Rect aperture(5, 5, 1, 1);
65 bool fill_center = true; 66 bool fill_center = true;
66 test_layer->SetAperture(aperture); 67 test_layer->SetAperture(aperture);
67 test_layer->SetUIResourceId(resource->id()); 68 test_layer->SetUIResourceId(resource->id());
68 test_layer->SetFillCenter(fill_center); 69 test_layer->SetFillCenter(fill_center);
69 test_layer->Update(); 70 test_layer->Update();
70 71
71 EXPECT_TRUE(test_layer->DrawsContent()); 72 EXPECT_TRUE(test_layer->DrawsContent());
72 } 73 }
73 74
74 } // namespace 75 } // namespace
75 } // namespace cc 76 } // namespace cc
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/painted_scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698