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

Side by Side Diff: ui/ozone/demo/ozone_demo.cc

Issue 2351253002: Ozone Demo: Fix NOTREACHED assert when SwapBuffersAsync is not supported (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 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 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 <utility> 5 #include <utility>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 std::unique_ptr<ui::Renderer> RendererFactory::CreateRenderer( 212 std::unique_ptr<ui::Renderer> RendererFactory::CreateRenderer(
213 gfx::AcceleratedWidget widget, 213 gfx::AcceleratedWidget widget,
214 const gfx::Size& size) { 214 const gfx::Size& size) {
215 switch (type_) { 215 switch (type_) {
216 case GL: { 216 case GL: {
217 scoped_refptr<gl::GLSurface> surface = CreateGLSurface(widget); 217 scoped_refptr<gl::GLSurface> surface = CreateGLSurface(widget);
218 if (!surface) 218 if (!surface)
219 LOG(FATAL) << "Failed to create GL surface"; 219 LOG(FATAL) << "Failed to create GL surface";
220 if (!surface->SupportsAsyncSwap())
221 LOG(FATAL) << "GL surface must support SwapBuffersAsync";
220 if (surface->IsSurfaceless()) 222 if (surface->IsSurfaceless())
221 return base::MakeUnique<ui::SurfacelessGlRenderer>(widget, surface, 223 return base::MakeUnique<ui::SurfacelessGlRenderer>(widget, surface,
222 size); 224 size);
223 else 225 else
224 return base::MakeUnique<ui::GlRenderer>(widget, surface, size); 226 return base::MakeUnique<ui::GlRenderer>(widget, surface, size);
225 } 227 }
226 case SOFTWARE: 228 case SOFTWARE:
227 return base::MakeUnique<ui::SoftwareRenderer>(widget, size); 229 return base::MakeUnique<ui::SoftwareRenderer>(widget, size);
228 } 230 }
229 231
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ->SetCurrentLayoutByName("us"); 339 ->SetCurrentLayoutByName("us");
338 340
339 base::RunLoop run_loop; 341 base::RunLoop run_loop;
340 342
341 WindowManager window_manager(run_loop.QuitClosure()); 343 WindowManager window_manager(run_loop.QuitClosure());
342 344
343 run_loop.Run(); 345 run_loop.Run();
344 346
345 return 0; 347 return 0;
346 } 348 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698