Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ui/ozone/platform/dri/gbm_surfaceless.h" | |
| 6 | |
| 7 #include "ui/ozone/platform/dri/dri_vsync_provider.h" | |
| 8 #include "ui/ozone/platform/dri/gbm_buffer.h" | |
| 9 | |
| 10 namespace ui { | |
| 11 | |
| 12 GbmSurfaceless::GbmSurfaceless( | |
| 13 const base::WeakPtr<HardwareDisplayController>& controller) | |
| 14 : controller_(controller) {} | |
| 15 | |
| 16 GbmSurfaceless::~GbmSurfaceless() {} | |
| 17 | |
| 18 intptr_t GbmSurfaceless::GetNativeWindow() { | |
| 19 NOTREACHED(); | |
| 20 return 0; | |
| 21 } | |
| 22 | |
| 23 bool GbmSurfaceless::ResizeNativeWindow(const gfx::Size& viewport_size) { | |
| 24 NOTIMPLEMENTED(); | |
| 25 return false; | |
| 26 } | |
| 27 | |
| 28 bool GbmSurfaceless::OnSwapBuffers() { | |
| 29 if (!controller_) | |
| 30 return false; | |
| 31 | |
| 32 bool success = controller_->SchedulePageFlip(queued_planes_); | |
| 33 queued_planes_.clear(); | |
| 34 if (success) | |
| 35 controller_->WaitForPageFlipEvent(); | |
| 36 | |
| 37 return success; | |
| 38 } | |
| 39 | |
| 40 scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() { | |
| 41 return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(controller_)); | |
| 42 } | |
| 43 | |
| 44 bool GbmSurfaceless::ScheduleOverlayPlane( | |
| 45 int plane_z_order, | |
| 46 gfx::OverlayTransform plane_transform, | |
| 47 scoped_refptr<ui::NativePixmap> buffer, | |
| 48 const gfx::Rect& display_bounds, | |
| 49 const gfx::RectF& crop_rect) { | |
| 50 scoped_refptr<GbmPixmap> pixmap = | |
| 51 static_cast<GbmPixmap*>(buffer.get()); | |
| 52 if (!pixmap) { | |
| 53 LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer"; | |
|
alexst (slow to review)
2014/07/22 12:45:09
period at the end.
dnicoara
2014/07/22 14:05:46
Done.
| |
| 54 return false; | |
| 55 } | |
| 56 | |
| 57 queued_planes_.push_back(OverlayPlane(pixmap->buffer(), | |
| 58 plane_z_order, | |
| 59 plane_transform, | |
| 60 display_bounds, | |
| 61 crop_rect)); | |
| 62 return true; | |
| 63 } | |
| 64 | |
| 65 } // namespace ui | |
| OLD | NEW |