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

Side by Side Diff: examples/surfaces_app/surfaces_util.cc

Issue 1534693002: Delete the Surfaces service. (Closed) Base URL: git@github.com:domokit/mojo.git@cl-2d
Patch Set: rebase Created 5 years 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 | « examples/surfaces_app/surfaces_util.h ('k') | mojo/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "examples/surfaces_app/surfaces_util.h"
6
7 #include "cc/quads/render_pass.h"
8 #include "cc/quads/shared_quad_state.h"
9 #include "ui/gfx/rect.h"
10 #include "ui/gfx/size.h"
11 #include "ui/gfx/transform.h"
12
13 namespace mojo {
14 namespace examples {
15
16 using cc::SharedQuadState;
17
18 void CreateAndAppendSimpleSharedQuadState(cc::RenderPass* render_pass,
19 const gfx::Transform& transform,
20 const gfx::Size& size) {
21 const gfx::Size content_bounds = size;
22 const gfx::Rect visible_content_rect = gfx::Rect(size);
23 const gfx::Rect clip_rect = gfx::Rect(size);
24 bool is_clipped = false;
25 float opacity = 1.f;
26 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode;
27 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState();
28 shared_state->SetAll(transform,
29 content_bounds,
30 visible_content_rect,
31 clip_rect,
32 is_clipped,
33 opacity,
34 blend_mode,
35 0);
36 }
37
38 } // namespace mojo
39 } // namespace examples
OLDNEW
« no previous file with comments | « examples/surfaces_app/surfaces_util.h ('k') | mojo/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698