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

Unified Diff: mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove overzealous shutdown check in cc/surfaces, add NON_EXPORTED_BASE for windows build, saturate… Created 6 years, 3 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/services/public/cpp/surfaces/DEPS ('k') | mojo/services/public/cpp/surfaces/surfaces_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc
diff --git a/mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc b/mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c35a77a3cd1ba490b617f8bbf35419f10ae6ea6b
--- /dev/null
+++ b/mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc
@@ -0,0 +1,37 @@
+// 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/services/public/cpp/surfaces/surfaces_utils.h"
+
+#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/transform.h"
+
+namespace mojo {
+
+SharedQuadStatePtr CreateDefaultSQS(const gfx::Size& size) {
+ SharedQuadStatePtr sqs = SharedQuadState::New();
+ sqs->content_to_target_transform = Transform::From(gfx::Transform());
+ sqs->content_bounds = Size::From(size);
+ sqs->visible_content_rect = Rect::From(gfx::Rect(size));
+ sqs->clip_rect = Rect::From(gfx::Rect(size));
+ sqs->is_clipped = false;
+ sqs->opacity = 1.f;
+ sqs->blend_mode = mojo::SK_XFERMODE_kSrc_Mode;
+ sqs->sorting_context_id = 0;
+ return sqs.Pass();
+}
+
+PassPtr CreateDefaultPass(int id, const gfx::Rect& rect) {
+ PassPtr pass = Pass::New();
+ pass->id = id;
+ pass->output_rect = Rect::From(rect);
+ pass->damage_rect = Rect::From(rect);
+ pass->transform_to_root_target = Transform::From(gfx::Transform());
+ pass->has_transparent_background = false;
+ return pass.Pass();
+}
+
+} // namespace mojo
« no previous file with comments | « mojo/services/public/cpp/surfaces/DEPS ('k') | mojo/services/public/cpp/surfaces/surfaces_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698