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

Unified Diff: mojo/examples/surfaces_app/surfaces_util.cc

Issue 361123002: Mojo surfaces service and example app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/examples/surfaces_app/surfaces_util.h ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/surfaces_app/surfaces_util.cc
diff --git a/mojo/examples/surfaces_app/surfaces_util.cc b/mojo/examples/surfaces_app/surfaces_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..50bfbff0c3f24b4dc19f160524cc6d0f58cf4a89
--- /dev/null
+++ b/mojo/examples/surfaces_app/surfaces_util.cc
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/examples/surfaces_app/surfaces_util.h"
+
+#include "cc/quads/render_pass.h"
+#include "cc/quads/shared_quad_state.h"
+#include "ui/gfx/rect.h"
+#include "ui/gfx/size.h"
+#include "ui/gfx/transform.h"
+
+namespace mojo {
+namespace examples {
+
+using cc::SharedQuadState;
+
+void CreateAndAppendSimpleSharedQuadState(cc::RenderPass* render_pass,
+ const gfx::Transform& transform,
+ const gfx::Size& size) {
+ const gfx::Size content_bounds = size;
+ const gfx::Rect visible_content_rect = gfx::Rect(size);
+ const gfx::Rect clip_rect = gfx::Rect(size);
+ bool is_clipped = false;
+ float opacity = 1.f;
+ const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode;
+ SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState();
+ shared_state->SetAll(transform,
+ content_bounds,
+ visible_content_rect,
+ clip_rect,
+ is_clipped,
+ opacity,
+ blend_mode,
+ 0);
+}
+
+} // namespace mojo
+} // namespace examples
« no previous file with comments | « mojo/examples/surfaces_app/surfaces_util.h ('k') | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698