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

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

Issue 1104853002: Adds public API and loads Cast OSD plane implementation from shared lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some nits Created 5 years, 7 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 | « chromecast/public/osd_surface.h ('k') | no next file » | 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/surface_factory_cast.h" 5 #include "ui/ozone/platform/cast/surface_factory_cast.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "chromecast/public/cast_egl_platform.h" 8 #include "chromecast/public/cast_egl_platform.h"
9 #include "chromecast/public/graphics_types.h"
9 #include "ui/ozone/platform/cast/surface_ozone_egl_cast.h" 10 #include "ui/ozone/platform/cast/surface_ozone_egl_cast.h"
10 11
11 using chromecast::CastEglPlatform; 12 using chromecast::CastEglPlatform;
12 13
13 namespace ui { 14 namespace ui {
14 namespace { 15 namespace {
15 CastEglPlatform::Size FromGfxSize(const gfx::Size& size) { 16 chromecast::Size FromGfxSize(const gfx::Size& size) {
16 return CastEglPlatform::Size(size.width(), size.height()); 17 return chromecast::Size(size.width(), size.height());
17 } 18 }
18 19
19 // Hard lower bound on display resolution 20 // Hard lower bound on display resolution
20 gfx::Size GetMinDisplaySize() { 21 gfx::Size GetMinDisplaySize() {
21 return gfx::Size(1280, 720); 22 return gfx::Size(1280, 720);
22 } 23 }
23 24
24 } // namespace 25 } // namespace
25 26
26 SurfaceFactoryCast::SurfaceFactoryCast(scoped_ptr<CastEglPlatform> egl_platform) 27 SurfaceFactoryCast::SurfaceFactoryCast(scoped_ptr<CastEglPlatform> egl_platform)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void SurfaceFactoryCast::CreateDisplayTypeAndWindowIfNeeded() { 69 void SurfaceFactoryCast::CreateDisplayTypeAndWindowIfNeeded() {
69 if (state_ == kUninitialized) { 70 if (state_ == kUninitialized) {
70 InitializeHardware(); 71 InitializeHardware();
71 } 72 }
72 if (new_display_size_ != display_size_) { 73 if (new_display_size_ != display_size_) {
73 DestroyDisplayTypeAndWindow(); 74 DestroyDisplayTypeAndWindow();
74 display_size_ = new_display_size_; 75 display_size_ = new_display_size_;
75 } 76 }
76 DCHECK_EQ(state_, kInitialized); 77 DCHECK_EQ(state_, kInitialized);
77 if (!have_display_type_) { 78 if (!have_display_type_) {
78 CastEglPlatform::Size create_size = FromGfxSize(display_size_); 79 chromecast::Size create_size = FromGfxSize(display_size_);
79 display_type_ = egl_platform_->CreateDisplayType(create_size); 80 display_type_ = egl_platform_->CreateDisplayType(create_size);
80 have_display_type_ = true; 81 have_display_type_ = true;
81 window_ = egl_platform_->CreateWindow(display_type_, create_size); 82 window_ = egl_platform_->CreateWindow(display_type_, create_size);
82 if (!window_) { 83 if (!window_) {
83 DestroyDisplayTypeAndWindow(); 84 DestroyDisplayTypeAndWindow();
84 state_ = kFailed; 85 state_ = kFailed;
85 LOG(FATAL) << "Create EGLNativeWindowType(" << display_size_.ToString() 86 LOG(FATAL) << "Create EGLNativeWindowType(" << display_size_.ToString()
86 << ") failed."; 87 << ") failed.";
87 } 88 }
88 } 89 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return false; 185 return false;
185 } 186 }
186 187
187 set_gl_get_proc_address.Run(gl_proc); 188 set_gl_get_proc_address.Run(gl_proc);
188 add_gl_library.Run(lib_egl); 189 add_gl_library.Run(lib_egl);
189 add_gl_library.Run(lib_gles2); 190 add_gl_library.Run(lib_gles2);
190 return true; 191 return true;
191 } 192 }
192 193
193 } // namespace ui 194 } // namespace ui
OLDNEW
« no previous file with comments | « chromecast/public/osd_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698