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

Side by Side Diff: ui/ozone/platform/dri/overlay_plane.cc

Issue 779173007: Fix crash when we don't have a plane to display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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/ozone/platform/dri/overlay_plane.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 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 "ui/ozone/platform/dri/overlay_plane.h" 5 #include "ui/ozone/platform/dri/overlay_plane.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/ozone/platform/dri/scanout_buffer.h" 8 #include "ui/ozone/platform/dri/scanout_buffer.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 14 matching lines...) Expand all
25 z_order(z_order), 25 z_order(z_order),
26 plane_transform(plane_transform), 26 plane_transform(plane_transform),
27 display_bounds(display_bounds), 27 display_bounds(display_bounds),
28 crop_rect(crop_rect) { 28 crop_rect(crop_rect) {
29 } 29 }
30 30
31 OverlayPlane::~OverlayPlane() { 31 OverlayPlane::~OverlayPlane() {
32 } 32 }
33 33
34 // static 34 // static
35 const OverlayPlane& OverlayPlane::GetPrimaryPlane( 35 const OverlayPlane* OverlayPlane::GetPrimaryPlane(
36 const OverlayPlaneList& overlays) { 36 const OverlayPlaneList& overlays) {
37 for (size_t i = 0; i < overlays.size(); ++i) { 37 for (size_t i = 0; i < overlays.size(); ++i) {
38 if (overlays[i].z_order == 0) 38 if (overlays[i].z_order == 0)
39 return overlays[i]; 39 return &overlays[i];
40 } 40 }
41 41
42 NOTREACHED(); 42 return nullptr;
43 return overlays[0];
44 } 43 }
45 44
46 } // namespace ui 45 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/overlay_plane.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698