OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/renderer_host/backing_store.h" | 5 #include "chrome/browser/renderer_host/backing_store.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <sys/ipc.h> | 8 #include <sys/ipc.h> |
9 #include <sys/shm.h> | 9 #include <sys/shm.h> |
10 #if defined(TOOLKIT_GTK) | 10 #if defined(TOOLKIT_GTK) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void* visual, | 50 void* visual, |
51 int depth) | 51 int depth) |
52 : render_widget_host_(widget), | 52 : render_widget_host_(widget), |
53 size_(size), | 53 size_(size), |
54 display_(x11_util::GetXDisplay()), | 54 display_(x11_util::GetXDisplay()), |
55 use_shared_memory_(x11_util::QuerySharedMemorySupport(display_)), | 55 use_shared_memory_(x11_util::QuerySharedMemorySupport(display_)), |
56 use_render_(x11_util::QueryRenderSupport(display_)), | 56 use_render_(x11_util::QueryRenderSupport(display_)), |
57 visual_(visual), | 57 visual_(visual), |
58 visual_depth_(depth), | 58 visual_depth_(depth), |
59 root_window_(x11_util::GetX11RootWindow()) { | 59 root_window_(x11_util::GetX11RootWindow()) { |
| 60 #if defined(OS_FREEBSD) |
| 61 COMPILE_ASSERT(BYTE_ORDER == LITTLE_ENDIAN, assumes_little_endian); |
| 62 #else |
60 COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN, assumes_little_endian); | 63 COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN, assumes_little_endian); |
| 64 #endif |
61 | 65 |
62 pixmap_ = XCreatePixmap(display_, root_window_, | 66 pixmap_ = XCreatePixmap(display_, root_window_, |
63 size.width(), size.height(), depth); | 67 size.width(), size.height(), depth); |
64 | 68 |
65 if (use_render_) { | 69 if (use_render_) { |
66 picture_ = XRenderCreatePicture( | 70 picture_ = XRenderCreatePicture( |
67 display_, pixmap_, | 71 display_, pixmap_, |
68 x11_util::GetRenderVisualFormat(display_, | 72 x11_util::GetRenderVisualFormat(display_, |
69 static_cast<Visual*>(visual)), | 73 static_cast<Visual*>(visual)), |
70 0, NULL); | 74 0, NULL); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 434 |
431 if (use_shared_memory_) | 435 if (use_shared_memory_) |
432 DestroySharedImage(display_, image, &shminfo); | 436 DestroySharedImage(display_, image, &shminfo); |
433 else | 437 else |
434 XFree(image); | 438 XFree(image); |
435 | 439 |
436 HISTOGRAM_TIMES("BackingStore.RetrievalFromX", | 440 HISTOGRAM_TIMES("BackingStore.RetrievalFromX", |
437 base::TimeTicks::Now() - begin_time); | 441 base::TimeTicks::Now() - begin_time); |
438 return bitmap; | 442 return bitmap; |
439 } | 443 } |
OLD | NEW |