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

Side by Side Diff: components/exo/surface_unittest.cc

Issue 2502373003: stop using SkXfermode -- use SkBlendMode instead (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « components/exo/surface.cc ('k') | components/exo/wayland/server.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "cc/output/compositor_frame.h" 6 #include "cc/output/compositor_frame.h"
7 #include "cc/quads/texture_draw_quad.h" 7 #include "cc/quads/texture_draw_quad.h"
8 #include "cc/surfaces/surface.h" 8 #include "cc/surfaces/surface.h"
9 #include "cc/surfaces/surface_manager.h" 9 #include "cc/surfaces/surface_manager.h"
10 #include "components/exo/buffer.h" 10 #include "components/exo/buffer.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return frame; 196 return frame;
197 } 197 }
198 198
199 TEST_F(SurfaceTest, SetBlendMode) { 199 TEST_F(SurfaceTest, SetBlendMode) {
200 gfx::Size buffer_size(1, 1); 200 gfx::Size buffer_size(1, 1);
201 std::unique_ptr<Buffer> buffer( 201 std::unique_ptr<Buffer> buffer(
202 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); 202 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
203 std::unique_ptr<Surface> surface(new Surface); 203 std::unique_ptr<Surface> surface(new Surface);
204 204
205 surface->Attach(buffer.get()); 205 surface->Attach(buffer.get());
206 surface->SetBlendMode(SkXfermode::kSrc_Mode); 206 surface->SetBlendMode(SkBlendMode::kSrc);
207 surface->Commit(); 207 surface->Commit();
208 208
209 const cc::CompositorFrame& frame = GetFrameFromSurface(surface.get()); 209 const cc::CompositorFrame& frame = GetFrameFromSurface(surface.get());
210 ASSERT_EQ(1u, frame.render_pass_list.size()); 210 ASSERT_EQ(1u, frame.render_pass_list.size());
211 ASSERT_EQ(1u, frame.render_pass_list.back()->quad_list.size()); 211 ASSERT_EQ(1u, frame.render_pass_list.back()->quad_list.size());
212 EXPECT_FALSE(frame.render_pass_list.back() 212 EXPECT_FALSE(frame.render_pass_list.back()
213 ->quad_list.back() 213 ->quad_list.back()
214 ->ShouldDrawWithBlending()); 214 ->ShouldDrawWithBlending());
215 } 215 }
216 216
(...skipping 30 matching lines...) Expand all
247 247
248 TEST_F(SurfaceTest, Commit) { 248 TEST_F(SurfaceTest, Commit) {
249 std::unique_ptr<Surface> surface(new Surface); 249 std::unique_ptr<Surface> surface(new Surface);
250 250
251 // Calling commit without a buffer should succeed. 251 // Calling commit without a buffer should succeed.
252 surface->Commit(); 252 surface->Commit();
253 } 253 }
254 254
255 } // namespace 255 } // namespace
256 } // namespace exo 256 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/surface.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698