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

Unified Diff: ui/ozone/platform/dri/gbm_surfaceless.cc

Issue 403043004: [Ozone-DRI] Remove unneeded wrappers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/gbm_surfaceless.h ('k') | ui/ozone/platform/dri/scanout_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/gbm_surfaceless.cc
diff --git a/ui/ozone/platform/dri/gbm_surfaceless.cc b/ui/ozone/platform/dri/gbm_surfaceless.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1ace55720f4319db192fd70ddb989b2329bffd86
--- /dev/null
+++ b/ui/ozone/platform/dri/gbm_surfaceless.cc
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/dri/gbm_surfaceless.h"
+
+#include "ui/ozone/platform/dri/dri_vsync_provider.h"
+#include "ui/ozone/platform/dri/gbm_buffer.h"
+
+namespace ui {
+
+GbmSurfaceless::GbmSurfaceless(
+ const base::WeakPtr<HardwareDisplayController>& controller)
+ : controller_(controller) {}
+
+GbmSurfaceless::~GbmSurfaceless() {}
+
+intptr_t GbmSurfaceless::GetNativeWindow() {
+ NOTREACHED();
+ return 0;
+}
+
+bool GbmSurfaceless::ResizeNativeWindow(const gfx::Size& viewport_size) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool GbmSurfaceless::OnSwapBuffers() {
+ if (!controller_)
+ return false;
+
+ bool success = controller_->SchedulePageFlip(queued_planes_);
+ queued_planes_.clear();
+ if (success)
+ controller_->WaitForPageFlipEvent();
+
+ return success;
+}
+
+scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() {
+ return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(controller_));
+}
+
+bool GbmSurfaceless::ScheduleOverlayPlane(
+ int plane_z_order,
+ gfx::OverlayTransform plane_transform,
+ scoped_refptr<ui::NativePixmap> buffer,
+ const gfx::Rect& display_bounds,
+ const gfx::RectF& crop_rect) {
+ scoped_refptr<GbmPixmap> pixmap =
+ static_cast<GbmPixmap*>(buffer.get());
+ if (!pixmap) {
+ LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer.";
+ return false;
+ }
+
+ queued_planes_.push_back(OverlayPlane(pixmap->buffer(),
+ plane_z_order,
+ plane_transform,
+ display_bounds,
+ crop_rect));
+ return true;
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/gbm_surfaceless.h ('k') | ui/ozone/platform/dri/scanout_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698