| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "app/x11_util.h" | 9 #include "app/x11_util.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/renderer_host/backing_store.h" | 12 #include "chrome/browser/renderer_host/backing_store.h" |
| 13 | 13 |
| 14 namespace gfx { |
| 15 class Point; |
| 16 class Rect; |
| 17 } // namespace gfx |
| 18 |
| 14 typedef struct _GdkDrawable GdkDrawable; | 19 typedef struct _GdkDrawable GdkDrawable; |
| 15 class SkBitmap; | 20 class SkBitmap; |
| 16 | 21 |
| 17 class BackingStoreX : public BackingStore { | 22 class BackingStoreX : public BackingStore { |
| 18 public: | 23 public: |
| 19 // Create a backing store on the X server. The visual is an Xlib Visual | 24 // Create a backing store on the X server. The visual is an Xlib Visual |
| 20 // describing the format of the target window and the depth is the color | 25 // describing the format of the target window and the depth is the color |
| 21 // depth of the X window which will be drawn into. | 26 // depth of the X window which will be drawn into. |
| 22 BackingStoreX(RenderWidgetHost* widget, | 27 BackingStoreX(RenderWidgetHost* widget, |
| 23 const gfx::Size& size, | 28 const gfx::Size& size, |
| 24 void* visual, | 29 void* visual, |
| 25 int depth); | 30 int depth); |
| 26 | 31 |
| 27 // This is for unittesting only. An object constructed using this constructor | 32 // This is for unittesting only. An object constructed using this constructor |
| 28 // will silently ignore all paints | 33 // will silently ignore all paints |
| 29 BackingStoreX(RenderWidgetHost* widget, const gfx::Size& size); | 34 BackingStoreX(RenderWidgetHost* widget, const gfx::Size& size); |
| 30 | 35 |
| 31 virtual ~BackingStoreX(); | 36 virtual ~BackingStoreX(); |
| 32 | 37 |
| 33 Display* display() const { return display_; } | 38 Display* display() const { return display_; } |
| 34 XID root_window() const { return root_window_; } | 39 XID root_window() const { return root_window_; } |
| 35 | 40 |
| 36 // Copy from the server-side backing store to the target window | 41 // Copy from the server-side backing store to the target window |
| 37 // display: the display of the backing store and target window | 42 // origin: the destination rectangle origin |
| 38 // damage: the area to copy | 43 // damage: the area to copy |
| 39 // target: the X id of the target window | 44 // target: the X id of the target window |
| 40 void XShowRect(const gfx::Rect& damage, XID target); | 45 void XShowRect(const gfx::Point &origin, const gfx::Rect& damage, |
| 46 XID target); |
| 41 | 47 |
| 42 // As above, but use Cairo instead of Xlib. | 48 // As above, but use Cairo instead of Xlib. |
| 43 void CairoShowRect(const gfx::Rect& damage, GdkDrawable* drawable); | 49 void CairoShowRect(const gfx::Rect& damage, GdkDrawable* drawable); |
| 44 | 50 |
| 45 #if defined(TOOLKIT_GTK) | 51 #if defined(TOOLKIT_GTK) |
| 46 // Paint the backing store into the target's |dest_rect|. | 52 // Paint the backing store into the target's |dest_rect|. |
| 47 void PaintToRect(const gfx::Rect& dest_rect, GdkDrawable* target); | 53 void PaintToRect(const gfx::Rect& dest_rect, GdkDrawable* target); |
| 48 #endif | 54 #endif |
| 49 | 55 |
| 50 // BackingStore implementation. | 56 // BackingStore implementation. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 XID pixmap_; | 92 XID pixmap_; |
| 87 // This is the RENDER picture pointing at |pixmap_|. | 93 // This is the RENDER picture pointing at |pixmap_|. |
| 88 XID picture_; | 94 XID picture_; |
| 89 // This is a default graphic context, used in XCopyArea | 95 // This is a default graphic context, used in XCopyArea |
| 90 void* pixmap_gc_; | 96 void* pixmap_gc_; |
| 91 | 97 |
| 92 DISALLOW_COPY_AND_ASSIGN(BackingStoreX); | 98 DISALLOW_COPY_AND_ASSIGN(BackingStoreX); |
| 93 }; | 99 }; |
| 94 | 100 |
| 95 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ | 101 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ |
| OLD | NEW |