OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/backing_store_gtk.h" | 5 #include "content/browser/renderer_host/backing_store_gtk.h" |
6 | 6 |
7 #include <cairo-xlib.h> | 7 #include <cairo-xlib.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/ipc.h> | 10 #include <sys/ipc.h> |
11 #include <sys/shm.h> | 11 #include <sys/shm.h> |
12 #include <X11/extensions/sync.h> | 12 #include <X11/extensions/sync.h> |
13 | 13 |
14 #if defined(OS_OPENBSD) || defined(OS_FREEBSD) | 14 #if defined(OS_OPENBSD) || defined(OS_FREEBSD) |
15 #include <sys/endian.h> | 15 #include <sys/endian.h> |
16 #endif | 16 #endif |
17 | 17 |
18 #include <algorithm> | 18 #include <algorithm> |
19 #include <utility> | |
20 #include <limits> | 19 #include <limits> |
21 #include <queue> | 20 #include <queue> |
| 21 #include <utility> |
22 | 22 |
23 #include "base/compiler_specific.h" | 23 #include "base/compiler_specific.h" |
24 #include "base/logging.h" | 24 #include "base/logging.h" |
25 #include "base/memory/singleton.h" | 25 #include "base/memory/singleton.h" |
26 #include "base/metrics/histogram.h" | 26 #include "base/metrics/histogram.h" |
27 #include "base/time.h" | 27 #include "base/time.h" |
28 #include "content/browser/renderer_host/render_process_host_impl.h" | 28 #include "content/browser/renderer_host/render_process_host_impl.h" |
29 #include "skia/ext/platform_canvas.h" | 29 #include "skia/ext/platform_canvas.h" |
30 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
| 31 #include "ui/base/gtk/gtk_signal.h" |
31 #include "ui/base/x/x11_util.h" | 32 #include "ui/base/x/x11_util.h" |
32 #include "ui/base/x/x11_util_internal.h" | 33 #include "ui/base/x/x11_util_internal.h" |
33 #include "ui/base/gtk/gtk_signal.h" | |
34 #include "ui/gfx/rect.h" | 34 #include "ui/gfx/rect.h" |
35 #include "ui/gfx/surface/transport_dib.h" | 35 #include "ui/surface/transport_dib.h" |
36 | 36 |
37 using content::RenderWidgetHost; | 37 using content::RenderWidgetHost; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 // Assume that somewhere along the line, someone will do width * height * 4 | 41 // Assume that somewhere along the line, someone will do width * height * 4 |
42 // with signed numbers. If the maximum value is 2**31, then 2**31 / 4 = | 42 // with signed numbers. If the maximum value is 2**31, then 2**31 / 4 = |
43 // 2**29 and floor(sqrt(2**29)) = 23170. | 43 // 2**29 and floor(sqrt(2**29)) = 23170. |
44 | 44 |
45 // Max height and width for layers | 45 // Max height and width for layers |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 cairo_set_source(cr, pattern); | 655 cairo_set_source(cr, pattern); |
656 cairo_pattern_destroy(pattern); | 656 cairo_pattern_destroy(pattern); |
657 | 657 |
658 cairo_identity_matrix(cr); | 658 cairo_identity_matrix(cr); |
659 | 659 |
660 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); | 660 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); |
661 cairo_fill(cr); | 661 cairo_fill(cr); |
662 cairo_destroy(cr); | 662 cairo_destroy(cr); |
663 } | 663 } |
664 #endif | 664 #endif |
OLD | NEW |