Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/drm/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/drm/gbm_surface_factory.h" |
| 6 | 6 |
| 7 #include <gbm.h> | 7 #include <gbm.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "third_party/khronos/EGL/egl.h" | 11 #include "third_party/khronos/EGL/egl.h" |
| 12 #include "ui/gfx/geometry/rect_conversions.h" | |
| 12 #include "ui/ozone/common/egl_util.h" | 13 #include "ui/ozone/common/egl_util.h" |
| 13 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 14 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
| 14 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 15 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
| 15 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 16 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
| 16 #include "ui/ozone/platform/drm/gpu/gbm_device.h" | 17 #include "ui/ozone/platform/drm/gpu/gbm_device.h" |
| 17 #include "ui/ozone/platform/drm/gpu/gbm_surface.h" | 18 #include "ui/ozone/platform/drm/gpu/gbm_surface.h" |
| 18 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" | 19 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" |
| 19 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" | 20 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" |
| 20 #include "ui/ozone/platform/drm/gpu/screen_manager.h" | 21 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
| 21 #include "ui/ozone/public/native_pixmap.h" | 22 #include "ui/ozone/public/native_pixmap.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 41 OverlayCandidatesOzone::OverlaySurfaceCandidate* overlay; | 42 OverlayCandidatesOzone::OverlaySurfaceCandidate* overlay; |
| 42 if (first->plane_z_order == 0) { | 43 if (first->plane_z_order == 0) { |
| 43 overlay = second; | 44 overlay = second; |
| 44 } else if (second->plane_z_order == 0) { | 45 } else if (second->plane_z_order == 0) { |
| 45 overlay = first; | 46 overlay = first; |
| 46 } else { | 47 } else { |
| 47 NOTREACHED(); | 48 NOTREACHED(); |
| 48 return; | 49 return; |
| 49 } | 50 } |
| 50 if (overlay->plane_z_order > 0 && | 51 if (overlay->plane_z_order > 0 && |
| 51 IsTransformSupported(overlay->transform)) { | 52 IsTransformSupported(overlay->transform) && |
| 53 gfx::IsNearestRectWithinDistance(overlay->display_rect, 0.01f)) { | |
|
danakj
2015/05/04 19:56:41
This magic number, can you leave a comment explain
halliwell
2015/05/04 21:38:16
Done.
| |
| 52 overlay->overlay_handled = true; | 54 overlay->overlay_handled = true; |
| 53 } | 55 } |
| 54 } | 56 } |
| 55 } | 57 } |
| 56 | 58 |
| 57 private: | 59 private: |
| 58 bool IsTransformSupported(gfx::OverlayTransform transform) { | 60 bool IsTransformSupported(gfx::OverlayTransform transform) { |
| 59 switch (transform) { | 61 switch (transform) { |
| 60 case gfx::OVERLAY_TRANSFORM_NONE: | 62 case gfx::OVERLAY_TRANSFORM_NONE: |
| 61 return true; | 63 return true; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 return false; | 214 return false; |
| 213 } | 215 } |
| 214 | 216 |
| 215 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( | 217 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( |
| 216 gfx::AcceleratedWidget widget) { | 218 gfx::AcceleratedWidget widget) { |
| 217 return static_cast<GbmDevice*>( | 219 return static_cast<GbmDevice*>( |
| 218 drm_device_manager_->GetDrmDevice(widget).get()); | 220 drm_device_manager_->GetDrmDevice(widget).get()); |
| 219 } | 221 } |
| 220 | 222 |
| 221 } // namespace ui | 223 } // namespace ui |
| OLD | NEW |