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

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

Issue 331533002: Use a struct for cc::Surface ids for more type safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add is_null and explicit ctor Created 6 years, 6 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 | Annotate | Revision Log
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/surfaces/surface_aggregator_test_helpers.h" 5 #include "cc/surfaces/surface_aggregator_test_helpers.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "cc/layers/append_quads_data.h" 9 #include "cc/layers/append_quads_data.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
11 #include "cc/output/delegated_frame_data.h" 11 #include "cc/output/delegated_frame_data.h"
12 #include "cc/quads/render_pass_draw_quad.h" 12 #include "cc/quads/render_pass_draw_quad.h"
13 #include "cc/quads/shared_quad_state.h" 13 #include "cc/quads/shared_quad_state.h"
14 #include "cc/quads/solid_color_draw_quad.h" 14 #include "cc/quads/solid_color_draw_quad.h"
15 #include "cc/quads/surface_draw_quad.h" 15 #include "cc/quads/surface_draw_quad.h"
16 #include "cc/surfaces/surface.h" 16 #include "cc/surfaces/surface.h"
17 #include "cc/test/render_pass_test_common.h" 17 #include "cc/test/render_pass_test_common.h"
18 #include "cc/test/render_pass_test_utils.h" 18 #include "cc/test/render_pass_test_utils.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 #include "third_party/skia/include/core/SkXfermode.h" 20 #include "third_party/skia/include/core/SkXfermode.h"
21 21
22 namespace cc { 22 namespace cc {
23 namespace test { 23 namespace test {
24 24
25 void AddTestSurfaceQuad(TestRenderPass* pass, 25 void AddTestSurfaceQuad(TestRenderPass* pass,
26 const gfx::Size& surface_size, 26 const gfx::Size& surface_size,
27 int surface_id) { 27 SurfaceId surface_id) {
28 gfx::Transform content_to_target_transform; 28 gfx::Transform content_to_target_transform;
29 gfx::Size content_bounds = surface_size; 29 gfx::Size content_bounds = surface_size;
30 gfx::Rect visible_content_rect = gfx::Rect(surface_size); 30 gfx::Rect visible_content_rect = gfx::Rect(surface_size);
31 gfx::Rect clip_rect = gfx::Rect(surface_size); 31 gfx::Rect clip_rect = gfx::Rect(surface_size);
32 bool is_clipped = false; 32 bool is_clipped = false;
33 float opacity = 1.0; 33 float opacity = 1.0;
34 SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; 34 SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode;
35 35
36 SharedQuadState* shared_quad_state = pass->CreateAndAppendSharedQuadState(); 36 SharedQuadState* shared_quad_state = pass->CreateAndAppendSharedQuadState();
37 shared_quad_state->SetAll(content_to_target_transform, 37 shared_quad_state->SetAll(content_to_target_transform,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 delegated_frame_data->render_pass_list.push_back(pass.Pass()); 161 delegated_frame_data->render_pass_list.push_back(pass.Pass());
162 162
163 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); 163 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame);
164 child_frame->delegated_frame_data = delegated_frame_data.Pass(); 164 child_frame->delegated_frame_data = delegated_frame_data.Pass();
165 165
166 surface->QueueFrame(child_frame.Pass()); 166 surface->QueueFrame(child_frame.Pass());
167 } 167 }
168 168
169 } // namespace test 169 } // namespace test
170 } // namespace cc 170 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_aggregator_test_helpers.h ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698