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

Side by Side Diff: services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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 | « remoting/test/frame_generator_util.cc ('k') | skia/config/SkUserConfig.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "services/ui/public/interfaces/cursor/cursor_struct_traits.h" 5 #include "services/ui/public/interfaces/cursor/cursor_struct_traits.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "mojo/common/common_custom_types_struct_traits.h" 8 #include "mojo/common/common_custom_types_struct_traits.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "services/ui/public/interfaces/cursor/cursor.mojom.h" 10 #include "services/ui/public/interfaces/cursor/cursor.mojom.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 EXPECT_TRUE(copy.IsSameAs(output)); 82 EXPECT_TRUE(copy.IsSameAs(output));
83 83
84 // But make sure that the pixel data actually is equivalent. 84 // But make sure that the pixel data actually is equivalent.
85 ASSERT_EQ(input.cursor_frames().size(), output.cursor_frames().size()); 85 ASSERT_EQ(input.cursor_frames().size(), output.cursor_frames().size());
86 for (size_t f = 0; f < input.cursor_frames().size(); ++f) { 86 for (size_t f = 0; f < input.cursor_frames().size(); ++f) {
87 ASSERT_EQ(input.cursor_frames()[f].width(), 87 ASSERT_EQ(input.cursor_frames()[f].width(),
88 output.cursor_frames()[f].width()); 88 output.cursor_frames()[f].width());
89 ASSERT_EQ(input.cursor_frames()[f].height(), 89 ASSERT_EQ(input.cursor_frames()[f].height(),
90 output.cursor_frames()[f].height()); 90 output.cursor_frames()[f].height());
91 91
92 input.cursor_frames()[f].lockPixels();
93 output.cursor_frames()[f].lockPixels();
94 for (int x = 0; x < input.cursor_frames()[f].width(); ++x) { 92 for (int x = 0; x < input.cursor_frames()[f].width(); ++x) {
95 for (int y = 0; y < input.cursor_frames()[f].height(); ++y) { 93 for (int y = 0; y < input.cursor_frames()[f].height(); ++y) {
96 EXPECT_EQ(input.cursor_frames()[f].getColor(x, y), 94 EXPECT_EQ(input.cursor_frames()[f].getColor(x, y),
97 output.cursor_frames()[f].getColor(x, y)); 95 output.cursor_frames()[f].getColor(x, y));
98 } 96 }
99 } 97 }
100
101 output.cursor_frames()[f].unlockPixels();
102 input.cursor_frames()[f].unlockPixels();
103 } 98 }
104 } 99 }
105 100
106 } // namespace ui 101 } // namespace ui
OLDNEW
« no previous file with comments | « remoting/test/frame_generator_util.cc ('k') | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698