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

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

Issue 197883017: SkColorType instead of (deprecated) SkBitmap::Config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments from #5 Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/nine_patch_layer_impl_unittest.cc ('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/prioritized_resource_manager.h" 7 #include "cc/resources/prioritized_resource_manager.h"
8 #include "cc/resources/resource_provider.h" 8 #include "cc/resources/resource_provider.h"
9 #include "cc/resources/resource_update_queue.h" 9 #include "cc/resources/resource_update_queue.h"
10 #include "cc/resources/scoped_ui_resource.h" 10 #include "cc/resources/scoped_ui_resource.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); 57 EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get());
58 58
59 ResourceUpdateQueue queue; 59 ResourceUpdateQueue queue;
60 gfx::Rect screen_space_clip_rect; 60 gfx::Rect screen_space_clip_rect;
61 OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); 61 OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
62 test_layer->SavePaintProperties(); 62 test_layer->SavePaintProperties();
63 test_layer->Update(&queue, &occlusion_tracker); 63 test_layer->Update(&queue, &occlusion_tracker);
64 64
65 EXPECT_FALSE(test_layer->DrawsContent()); 65 EXPECT_FALSE(test_layer->DrawsContent());
66 66
67 SkBitmap bitmap; 67 bool is_opaque = false;
68 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
69 bitmap.allocPixels();
70 bitmap.setImmutable();
71
72 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( 68 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create(
73 layer_tree_host_.get(), UIResourceBitmap(bitmap)); 69 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque));
74 gfx::Rect aperture(5, 5, 1, 1); 70 gfx::Rect aperture(5, 5, 1, 1);
75 bool fill_center = true; 71 bool fill_center = true;
76 test_layer->SetAperture(aperture); 72 test_layer->SetAperture(aperture);
77 test_layer->SetUIResourceId(resource->id()); 73 test_layer->SetUIResourceId(resource->id());
78 test_layer->SetFillCenter(fill_center); 74 test_layer->SetFillCenter(fill_center);
79 test_layer->Update(&queue, &occlusion_tracker); 75 test_layer->Update(&queue, &occlusion_tracker);
80 76
81 EXPECT_TRUE(test_layer->DrawsContent()); 77 EXPECT_TRUE(test_layer->DrawsContent());
82 } 78 }
83 79
84 } // namespace 80 } // namespace
85 } // namespace cc 81 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_impl_unittest.cc ('k') | cc/layers/painted_scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698