| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_GTK_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_GTK_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_GTK_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "content/browser/renderer_host/backing_store.h" | 13 #include "content/browser/renderer_host/backing_store.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "ui/base/x/x11_util.h" | 15 #include "ui/base/x/x11_util.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Point; | 18 class Point; |
| 19 class Rect; | 19 class Rect; |
| 20 } // namespace gfx | 20 } // namespace gfx |
| 21 | 21 |
| 22 |
| 22 typedef struct _GdkDrawable GdkDrawable; | 23 typedef struct _GdkDrawable GdkDrawable; |
| 23 | 24 |
| 24 class CONTENT_EXPORT BackingStoreGtk : public BackingStore { | 25 class CONTENT_EXPORT BackingStoreGtk : public BackingStore { |
| 25 public: | 26 public: |
| 26 // Create a backing store on the X server. The visual is an Xlib Visual | 27 // Create a backing store on the X server. The visual is an Xlib Visual |
| 27 // describing the format of the target window and the depth is the color | 28 // describing the format of the target window and the depth is the color |
| 28 // depth of the X window which will be drawn into. | 29 // depth of the X window which will be drawn into. |
| 29 BackingStoreGtk(RenderWidgetHost* widget, | 30 BackingStoreGtk(RenderWidgetHost* widget, |
| 30 const gfx::Size& size, | 31 const gfx::Size& size, |
| 31 void* visual, | 32 void* visual, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 void CairoShowRect(const gfx::Rect& damage, GdkDrawable* drawable); | 52 void CairoShowRect(const gfx::Rect& damage, GdkDrawable* drawable); |
| 52 | 53 |
| 53 #if defined(TOOLKIT_GTK) | 54 #if defined(TOOLKIT_GTK) |
| 54 // Paint the backing store into the target's |dest_rect|. | 55 // Paint the backing store into the target's |dest_rect|. |
| 55 void PaintToRect(const gfx::Rect& dest_rect, GdkDrawable* target); | 56 void PaintToRect(const gfx::Rect& dest_rect, GdkDrawable* target); |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 // BackingStore implementation. | 59 // BackingStore implementation. |
| 59 virtual size_t MemorySize() OVERRIDE; | 60 virtual size_t MemorySize() OVERRIDE; |
| 60 virtual void PaintToBackingStore( | 61 virtual void PaintToBackingStore( |
| 61 RenderProcessHost* process, | 62 content::RenderProcessHost* process, |
| 62 TransportDIB::Id bitmap, | 63 TransportDIB::Id bitmap, |
| 63 const gfx::Rect& bitmap_rect, | 64 const gfx::Rect& bitmap_rect, |
| 64 const std::vector<gfx::Rect>& copy_rects, | 65 const std::vector<gfx::Rect>& copy_rects, |
| 65 const base::Closure& completion_callback, | 66 const base::Closure& completion_callback, |
| 66 bool* scheduled_completion_callback) OVERRIDE; | 67 bool* scheduled_completion_callback) OVERRIDE; |
| 67 virtual bool CopyFromBackingStore(const gfx::Rect& rect, | 68 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
| 68 skia::PlatformCanvas* output) OVERRIDE; | 69 skia::PlatformCanvas* output) OVERRIDE; |
| 69 virtual void ScrollBackingStore(int dx, int dy, | 70 virtual void ScrollBackingStore(int dx, int dy, |
| 70 const gfx::Rect& clip_rect, | 71 const gfx::Rect& clip_rect, |
| 71 const gfx::Size& view_size) OVERRIDE; | 72 const gfx::Size& view_size) OVERRIDE; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 96 XID pixmap_; | 97 XID pixmap_; |
| 97 // This is the RENDER picture pointing at |pixmap_|. | 98 // This is the RENDER picture pointing at |pixmap_|. |
| 98 XID picture_; | 99 XID picture_; |
| 99 // This is a default graphic context, used in XCopyArea | 100 // This is a default graphic context, used in XCopyArea |
| 100 void* pixmap_gc_; | 101 void* pixmap_gc_; |
| 101 | 102 |
| 102 DISALLOW_COPY_AND_ASSIGN(BackingStoreGtk); | 103 DISALLOW_COPY_AND_ASSIGN(BackingStoreGtk); |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_GTK_H_ | 106 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_GTK_H_ |
| OLD | NEW |