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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_readback.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/trees/layer_tree_host_pixeltest_masks.cc ('k') | cc/trees/layer_tree_host_unittest.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 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "cc/layers/content_layer.h" 6 #include "cc/layers/content_layer.h"
7 #include "cc/layers/solid_color_layer.h" 7 #include "cc/layers/solid_color_layer.h"
8 #include "cc/layers/texture_layer.h" 8 #include "cc/layers/texture_layer.h"
9 #include "cc/output/copy_output_request.h" 9 #include "cc/output/copy_output_request.h"
10 #include "cc/output/copy_output_result.h" 10 #include "cc/output/copy_output_result.h"
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 EXPECT_EQ(device_scale_factor_, layer_tree_host()->device_scale_factor()); 1102 EXPECT_EQ(device_scale_factor_, layer_tree_host()->device_scale_factor());
1103 if (TestEnded()) 1103 if (TestEnded())
1104 return; 1104 return;
1105 1105
1106 gfx::Rect device_viewport_copy_rect( 1106 gfx::Rect device_viewport_copy_rect(
1107 layer_tree_host()->device_viewport_size()); 1107 layer_tree_host()->device_viewport_size());
1108 if (!device_viewport_copy_subrect_.IsEmpty()) 1108 if (!device_viewport_copy_subrect_.IsEmpty())
1109 device_viewport_copy_rect.Intersect(device_viewport_copy_subrect_); 1109 device_viewport_copy_rect.Intersect(device_viewport_copy_subrect_);
1110 1110
1111 scoped_ptr<SkBitmap> bitmap(new SkBitmap); 1111 scoped_ptr<SkBitmap> bitmap(new SkBitmap);
1112 bitmap->setConfig(SkBitmap::kARGB_8888_Config, 1112 bitmap->allocN32Pixels(device_viewport_copy_rect.width(),
1113 device_viewport_copy_rect.width(), 1113 device_viewport_copy_rect.height());
1114 device_viewport_copy_rect.height()); 1114 layer_tree_host()->CompositeAndReadback(bitmap->getPixels(),
1115 bitmap->allocPixels(); 1115 device_viewport_copy_rect);
1116 {
1117 scoped_ptr<SkAutoLockPixels> lock(new SkAutoLockPixels(*bitmap));
1118 layer_tree_host()->CompositeAndReadback(bitmap->getPixels(),
1119 device_viewport_copy_rect);
1120 }
1121 1116
1122 result_bitmap_ = bitmap.Pass(); 1117 result_bitmap_ = bitmap.Pass();
1123 EndTest(); 1118 EndTest();
1124 } 1119 }
1125 1120
1126 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { 1121 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
1127 LayerImpl* root_impl = host_impl->active_tree()->root_layer(); 1122 LayerImpl* root_impl = host_impl->active_tree()->root_layer();
1128 1123
1129 LayerImpl* background_impl = root_impl->children()[0]; 1124 LayerImpl* background_impl = root_impl->children()[0];
1130 EXPECT_EQ(device_scale_factor_, background_impl->contents_scale_x()); 1125 EXPECT_EQ(device_scale_factor_, background_impl->contents_scale_x());
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 background, 1288 background,
1294 green.get(), 1289 green.get(),
1295 base::FilePath(FILE_PATH_LITERAL( 1290 base::FilePath(FILE_PATH_LITERAL(
1296 "green_with_blue_corner.png"))); 1291 "green_with_blue_corner.png")));
1297 } 1292 }
1298 1293
1299 } // namespace 1294 } // namespace
1300 } // namespace cc 1295 } // namespace cc
1301 1296
1302 #endif // OS_ANDROID 1297 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_masks.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698