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

Side by Side Diff: cc/test/surface_aggregator_test_helpers.cc

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 years, 10 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
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/test/surface_aggregator_test_helpers.h" 5 #include "cc/test/surface_aggregator_test_helpers.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 24 matching lines...) Expand all
35 35
36 SharedQuadState* shared_quad_state = pass->CreateAndAppendSharedQuadState(); 36 SharedQuadState* shared_quad_state = pass->CreateAndAppendSharedQuadState();
37 shared_quad_state->SetAll(layer_to_target_transform, layer_bounds, 37 shared_quad_state->SetAll(layer_to_target_transform, layer_bounds,
38 visible_layer_rect, clip_rect, is_clipped, opacity, 38 visible_layer_rect, clip_rect, is_clipped, opacity,
39 blend_mode, 0); 39 blend_mode, 0);
40 40
41 SurfaceDrawQuad* surface_quad = 41 SurfaceDrawQuad* surface_quad =
42 pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); 42 pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
43 gfx::Rect quad_rect = gfx::Rect(surface_size); 43 gfx::Rect quad_rect = gfx::Rect(surface_size);
44 surface_quad->SetNew(pass->shared_quad_state_list.back(), quad_rect, 44 surface_quad->SetNew(pass->shared_quad_state_list.back(), quad_rect,
45 quad_rect, surface_id); 45 quad_rect, surface_id, SurfaceDrawQuadType::PRIMARY,
46 nullptr);
46 } 47 }
47 48
48 void AddRenderPassQuad(RenderPass* pass, int render_pass_id) { 49 void AddRenderPassQuad(RenderPass* pass, int render_pass_id) {
49 gfx::Rect output_rect = gfx::Rect(0, 0, 5, 5); 50 gfx::Rect output_rect = gfx::Rect(0, 0, 5, 5);
50 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); 51 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
51 shared_state->SetAll(gfx::Transform(), output_rect.size(), output_rect, 52 shared_state->SetAll(gfx::Transform(), output_rect.size(), output_rect,
52 output_rect, false, 1, SkBlendMode::kSrcOver, 0); 53 output_rect, false, 1, SkBlendMode::kSrcOver, 0);
53 RenderPassDrawQuad* quad = 54 RenderPassDrawQuad* quad =
54 pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 55 pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
55 quad->SetNew(shared_state, output_rect, output_rect, render_pass_id, 0, 56 quad->SetNew(shared_state, output_rect, output_rect, render_pass_id, 0,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 130
130 for (size_t i = 0; i < passes->size(); ++i) { 131 for (size_t i = 0; i < passes->size(); ++i) {
131 SCOPED_TRACE(base::StringPrintf("Pass number %" PRIuS, i)); 132 SCOPED_TRACE(base::StringPrintf("Pass number %" PRIuS, i));
132 RenderPass* pass = (*passes)[i].get(); 133 RenderPass* pass = (*passes)[i].get();
133 TestPassMatchesExpectations(expected_passes[i], pass); 134 TestPassMatchesExpectations(expected_passes[i], pass);
134 } 135 }
135 } 136 }
136 137
137 } // namespace test 138 } // namespace test
138 } // namespace cc 139 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698