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

Side by Side Diff: ui/ozone/platform/cast/overlay_manager_cast.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
« no previous file with comments | « ui/keyboard/keyboard_util.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/ozone/platform/cast/overlay_manager_cast.h" 5 #include "ui/ozone/platform/cast/overlay_manager_cast.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "ui/gfx/geometry/rect_conversions.h" 9 #include "ui/gfx/geometry/rect_conversions.h"
10 #include "ui/ozone/public/overlay_candidates_ozone.h" 10 #include "ui/ozone/public/overlay_candidates_ozone.h"
11 11
12 namespace ui { 12 namespace ui {
13 namespace { 13 namespace {
14 14
15 base::LazyInstance<OverlayManagerCast::OverlayCompositedCallback> 15 base::LazyInstance<OverlayManagerCast::OverlayCompositedCallback>::
16 g_overlay_composited_callback = LAZY_INSTANCE_INITIALIZER; 16 DestructorAtExit g_overlay_composited_callback = LAZY_INSTANCE_INITIALIZER;
17 17
18 // Translates a gfx::OverlayTransform into a VideoPlane::Transform. 18 // Translates a gfx::OverlayTransform into a VideoPlane::Transform.
19 // Could be just a lookup table once we have unit tests for this code 19 // Could be just a lookup table once we have unit tests for this code
20 // to ensure it stays in sync with OverlayTransform. 20 // to ensure it stays in sync with OverlayTransform.
21 chromecast::media::VideoPlane::Transform ConvertTransform( 21 chromecast::media::VideoPlane::Transform ConvertTransform(
22 gfx::OverlayTransform transform) { 22 gfx::OverlayTransform transform) {
23 switch (transform) { 23 switch (transform) {
24 case gfx::OVERLAY_TRANSFORM_NONE: 24 case gfx::OVERLAY_TRANSFORM_NONE:
25 return chromecast::media::VideoPlane::TRANSFORM_NONE; 25 return chromecast::media::VideoPlane::TRANSFORM_NONE;
26 case gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL: 26 case gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return base::MakeUnique<OverlayCandidatesCast>(); 83 return base::MakeUnique<OverlayCandidatesCast>();
84 } 84 }
85 85
86 // static 86 // static
87 void OverlayManagerCast::SetOverlayCompositedCallback( 87 void OverlayManagerCast::SetOverlayCompositedCallback(
88 const OverlayCompositedCallback& cb) { 88 const OverlayCompositedCallback& cb) {
89 g_overlay_composited_callback.Get() = cb; 89 g_overlay_composited_callback.Get() = cb;
90 } 90 }
91 91
92 } // namespace ui 92 } // namespace ui
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_util.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698