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 "content/browser/compositor/software_output_device_x11.h" | 5 #include "content/browser/compositor/software_output_device_x11.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
7 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
8 #include <X11/Xutil.h> | 10 #include <X11/Xutil.h> |
9 | 11 |
10 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
11 #include "third_party/skia/include/core/SkImageInfo.h" | 13 #include "third_party/skia/include/core/SkImageInfo.h" |
12 #include "ui/base/x/x11_util.h" | 14 #include "ui/base/x/x11_util.h" |
13 #include "ui/base/x/x11_util_internal.h" | 15 #include "ui/base/x/x11_util_internal.h" |
14 #include "ui/compositor/compositor.h" | 16 #include "ui/compositor/compositor.h" |
15 #include "ui/gfx/x/x11_types.h" | 17 #include "ui/gfx/x/x11_types.h" |
16 | 18 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 XRenderFreePicture(display_, picture); | 111 XRenderFreePicture(display_, picture); |
110 XRenderFreePicture(display_, dest_picture); | 112 XRenderFreePicture(display_, dest_picture); |
111 XFreePixmap(display_, pixmap); | 113 XFreePixmap(display_, pixmap); |
112 return; | 114 return; |
113 } | 115 } |
114 | 116 |
115 // TODO(jbauman): Switch to XShmPutImage since it's async. | 117 // TODO(jbauman): Switch to XShmPutImage since it's async. |
116 SkImageInfo info; | 118 SkImageInfo info; |
117 size_t rowBytes; | 119 size_t rowBytes; |
118 const void* addr = surface_->peekPixels(&info, &rowBytes); | 120 const void* addr = surface_->peekPixels(&info, &rowBytes); |
119 gfx::PutARGBImage(display_, | 121 gfx::PutARGBImage( |
120 attributes_.visual, | 122 display_, attributes_.visual, attributes_.depth, compositor_->widget(), |
121 attributes_.depth, | 123 gc_, static_cast<const uint8_t*>(addr), viewport_pixel_size_.width(), |
122 compositor_->widget(), | 124 viewport_pixel_size_.height(), rect.x(), rect.y(), rect.x(), rect.y(), |
123 gc_, | 125 rect.width(), rect.height()); |
124 static_cast<const uint8*>(addr), | |
125 viewport_pixel_size_.width(), | |
126 viewport_pixel_size_.height(), | |
127 rect.x(), | |
128 rect.y(), | |
129 rect.x(), | |
130 rect.y(), | |
131 rect.width(), | |
132 rect.height()); | |
133 } | 126 } |
134 | 127 |
135 } // namespace content | 128 } // namespace content |
OLD | NEW |