| 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/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 CHECK(backbuffer()); | 53 CHECK(backbuffer()); |
| 54 return backbuffer()->GetHandle(); | 54 return backbuffer()->GetHandle(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void DriSurface::PreSwapBuffers() { | 57 void DriSurface::PreSwapBuffers() { |
| 58 } | 58 } |
| 59 | 59 |
| 60 // This call is made after the hardware just started displaying our back buffer. | 60 // This call is made after the hardware just started displaying our back buffer. |
| 61 // We need to update our pointer reference and synchronize the two buffers. | 61 // We need to update our pointer reference and synchronize the two buffers. |
| 62 void DriSurface::SwapBuffers() { | 62 void DriSurface::SwapBuffers() { |
| 63 CHECK(frontbuffer()); | |
| 64 CHECK(backbuffer()); | 63 CHECK(backbuffer()); |
| 65 | 64 |
| 66 // Update our front buffer pointer. | 65 // Update our front buffer pointer. |
| 67 front_buffer_ ^= 1; | 66 front_buffer_ ^= 1; |
| 68 } | 67 } |
| 69 | 68 |
| 70 gfx::Size DriSurface::Size() const { | 69 gfx::Size DriSurface::Size() const { |
| 71 return size_; | 70 return size_; |
| 72 } | 71 } |
| 73 | 72 |
| 74 SkCanvas* DriSurface::GetDrawableForWidget() { | 73 SkCanvas* DriSurface::GetDrawableForWidget() { |
| 75 CHECK(backbuffer()); | 74 CHECK(backbuffer()); |
| 76 return backbuffer()->GetCanvas(); | 75 return backbuffer()->GetCanvas(); |
| 77 } | 76 } |
| 78 | 77 |
| 79 } // namespace ui | 78 } // namespace ui |
| OLD | NEW |