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

Side by Side Diff: cc/surfaces/surfaces_pixeltest.cc

Issue 2502373003: stop using SkXfermode -- use SkBlendMode instead (Closed)
Patch Set: 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/output/compositor_frame.h" 5 #include "cc/output/compositor_frame.h"
6 #include "cc/quads/render_pass.h" 6 #include "cc/quads/render_pass.h"
7 #include "cc/quads/solid_color_draw_quad.h" 7 #include "cc/quads/solid_color_draw_quad.h"
8 #include "cc/quads/surface_draw_quad.h" 8 #include "cc/quads/surface_draw_quad.h"
9 #include "cc/surfaces/surface.h" 9 #include "cc/surfaces/surface.h"
10 #include "cc/surfaces/surface_aggregator.h" 10 #include "cc/surfaces/surface_aggregator.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 SharedQuadState* CreateAndAppendTestSharedQuadState( 43 SharedQuadState* CreateAndAppendTestSharedQuadState(
44 RenderPass* render_pass, 44 RenderPass* render_pass,
45 const gfx::Transform& transform, 45 const gfx::Transform& transform,
46 const gfx::Size& size) { 46 const gfx::Size& size) {
47 const gfx::Size layer_bounds = size; 47 const gfx::Size layer_bounds = size;
48 const gfx::Rect visible_layer_rect = gfx::Rect(size); 48 const gfx::Rect visible_layer_rect = gfx::Rect(size);
49 const gfx::Rect clip_rect = gfx::Rect(size); 49 const gfx::Rect clip_rect = gfx::Rect(size);
50 bool is_clipped = false; 50 bool is_clipped = false;
51 float opacity = 1.f; 51 float opacity = 1.f;
52 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; 52 const SkBlendMode blend_mode = SkBlendMode::kSrcOver;
53 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); 53 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState();
54 shared_state->SetAll(transform, layer_bounds, visible_layer_rect, clip_rect, 54 shared_state->SetAll(transform, layer_bounds, visible_layer_rect, clip_rect,
55 is_clipped, opacity, blend_mode, 0); 55 is_clipped, opacity, blend_mode, 0);
56 return shared_state; 56 return shared_state;
57 } 57 }
58 58
59 // Draws a very simple frame with no surface references. 59 // Draws a very simple frame with no surface references.
60 TEST_F(SurfacesPixelTest, DrawSimpleFrame) { 60 TEST_F(SurfacesPixelTest, DrawSimpleFrame) {
61 gfx::Rect rect(device_viewport_size_); 61 gfx::Rect rect(device_viewport_size_);
62 RenderPassId id(1, 1); 62 RenderPassId id(1, 1);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 338
339 factory_.Destroy(root_local_frame_id); 339 factory_.Destroy(root_local_frame_id);
340 factory_.Destroy(left_child_local_id); 340 factory_.Destroy(left_child_local_id);
341 factory_.Destroy(right_child_local_id); 341 factory_.Destroy(right_child_local_id);
342 } 342 }
343 343
344 } // namespace 344 } // namespace
345 } // namespace cc 345 } // namespace cc
346 346
347 #endif // !defined(OS_ANDROID) 347 #endif // !defined(OS_ANDROID)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698