| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/gfx/ozone/dri/dri_surface.h" | 5 #include "ui/gfx/ozone/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 11 matching lines...) Expand all Loading... |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Extends the SkBitmapDevice to allow setting the SkPixelRef. We use the setter | 24 // Extends the SkBitmapDevice to allow setting the SkPixelRef. We use the setter |
| 25 // to change the SkPixelRef such that the device always points to the | 25 // to change the SkPixelRef such that the device always points to the |
| 26 // backbuffer. | 26 // backbuffer. |
| 27 class CustomSkBitmapDevice : public SkBitmapDevice { | 27 class CustomSkBitmapDevice : public SkBitmapDevice { |
| 28 public: | 28 public: |
| 29 CustomSkBitmapDevice(const SkBitmap& bitmap) : SkBitmapDevice(bitmap) {} | 29 CustomSkBitmapDevice(const SkBitmap& bitmap) : SkBitmapDevice(bitmap) {} |
| 30 virtual ~CustomSkBitmapDevice() {} | 30 virtual ~CustomSkBitmapDevice() {} |
| 31 | 31 |
| 32 void SetPixelRef(SkPixelRef* pixel_ref) { setPixelRef(pixel_ref, 0); } | 32 void SetPixelRef(SkPixelRef* pixel_ref) { setPixelRef(pixel_ref); } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(CustomSkBitmapDevice); | 35 DISALLOW_COPY_AND_ASSIGN(CustomSkBitmapDevice); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
| 41 // DriSurface implementation | 41 // DriSurface implementation |
| 42 | 42 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 SkCanvas* DriSurface::GetDrawableForWidget() { | 105 SkCanvas* DriSurface::GetDrawableForWidget() { |
| 106 return skia_canvas_.get(); | 106 return skia_canvas_.get(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 DriSkBitmap* DriSurface::CreateBuffer() { | 109 DriSkBitmap* DriSurface::CreateBuffer() { |
| 110 return new DriSkBitmap(controller_->get_fd()); | 110 return new DriSkBitmap(controller_->get_fd()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace gfx | 113 } // namespace gfx |
| OLD | NEW |