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

Side by Side Diff: cc/quads/draw_quad_perftest.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 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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "cc/debug/lap_timer.h" 9 #include "cc/debug/lap_timer.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 10 matching lines...) Expand all
21 static const int kTimeCheckInterval = 10; 21 static const int kTimeCheckInterval = 10;
22 22
23 SharedQuadState* CreateSharedQuadState(RenderPass* render_pass) { 23 SharedQuadState* CreateSharedQuadState(RenderPass* render_pass) {
24 gfx::Transform quad_transform = gfx::Transform(1.0, 0.0, 0.5, 1.0, 0.5, 0.0); 24 gfx::Transform quad_transform = gfx::Transform(1.0, 0.0, 0.5, 1.0, 0.5, 0.0);
25 gfx::Size content_bounds(26, 28); 25 gfx::Size content_bounds(26, 28);
26 gfx::Rect visible_layer_rect(10, 12, 14, 16); 26 gfx::Rect visible_layer_rect(10, 12, 14, 16);
27 gfx::Rect clip_rect(19, 21, 23, 25); 27 gfx::Rect clip_rect(19, 21, 23, 25);
28 bool is_clipped = false; 28 bool is_clipped = false;
29 float opacity = 1.f; 29 float opacity = 1.f;
30 int sorting_context_id = 65536; 30 int sorting_context_id = 65536;
31 SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; 31 SkBlendMode blend_mode = SkBlendMode::kSrcOver;
32 32
33 SharedQuadState* state = render_pass->CreateAndAppendSharedQuadState(); 33 SharedQuadState* state = render_pass->CreateAndAppendSharedQuadState();
34 state->SetAll(quad_transform, content_bounds, visible_layer_rect, clip_rect, 34 state->SetAll(quad_transform, content_bounds, visible_layer_rect, clip_rect,
35 is_clipped, opacity, blend_mode, sorting_context_id); 35 is_clipped, opacity, blend_mode, sorting_context_id);
36 return state; 36 return state;
37 } 37 }
38 38
39 class DrawQuadPerfTest : public testing::Test { 39 class DrawQuadPerfTest : public testing::Test {
40 public: 40 public:
41 DrawQuadPerfTest() 41 DrawQuadPerfTest()
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 }; 104 };
105 105
106 TEST_F(DrawQuadPerfTest, IterateResources) { 106 TEST_F(DrawQuadPerfTest, IterateResources) {
107 RunIterateResourceTest("10_quads", 10); 107 RunIterateResourceTest("10_quads", 10);
108 RunIterateResourceTest("100_quads", 100); 108 RunIterateResourceTest("100_quads", 100);
109 RunIterateResourceTest("500_quads", 500); 109 RunIterateResourceTest("500_quads", 500);
110 } 110 }
111 111
112 } // namespace 112 } // namespace
113 } // namespace cc 113 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698