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

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

Issue 106633002: GBM Ozone implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/ozone/platform/dri/dri_surface.h ('k') | ui/ozone/platform/dri/dri_surface_factory.h » ('j') | 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/dri_surface.h" 5 #include "ui/ozone/platform/dri/dri_surface.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // This call is made after the hardware just started displaying our back buffer. 59 // This call is made after the hardware just started displaying our back buffer.
60 // We need to update our pointer reference and synchronize the two buffers. 60 // We need to update our pointer reference and synchronize the two buffers.
61 void DriSurface::SwapBuffers() { 61 void DriSurface::SwapBuffers() {
62 CHECK(frontbuffer()); 62 CHECK(frontbuffer());
63 CHECK(backbuffer()); 63 CHECK(backbuffer());
64 64
65 // Update our front buffer pointer. 65 // Update our front buffer pointer.
66 front_buffer_ ^= 1; 66 front_buffer_ ^= 1;
67 } 67 }
68 68
69 gfx::Size DriSurface::Size() const {
70 return size_;
71 }
72
69 SkCanvas* DriSurface::GetDrawableForWidget() { 73 SkCanvas* DriSurface::GetDrawableForWidget() {
70 CHECK(backbuffer()); 74 CHECK(backbuffer());
71 return backbuffer()->canvas(); 75 return backbuffer()->canvas();
72 } 76 }
73 77
74 DriBuffer* DriSurface::CreateBuffer() { return new DriBuffer(dri_); } 78 DriBuffer* DriSurface::CreateBuffer() { return new DriBuffer(dri_); }
75 79
76 } // namespace ui 80 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_surface.h ('k') | ui/ozone/platform/dri/dri_surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698