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_WIN_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "content/browser/renderer_host/backing_store.h" | 12 #include "content/browser/renderer_host/backing_store.h" |
13 | 13 |
14 class BackingStoreWin : public BackingStore { | 14 class BackingStoreWin : public BackingStore { |
15 public: | 15 public: |
16 BackingStoreWin(RenderWidgetHost* widget, const gfx::Size& size); | 16 BackingStoreWin(RenderWidgetHost* widget, const gfx::Size& size); |
17 virtual ~BackingStoreWin(); | 17 virtual ~BackingStoreWin(); |
18 | 18 |
19 HDC hdc() { return hdc_; } | 19 HDC hdc() { return hdc_; } |
20 | 20 |
21 // Returns true if we should convert to the monitor profile when painting. | 21 // Returns true if we should convert to the monitor profile when painting. |
22 static bool ColorManagementEnabled(); | 22 static bool ColorManagementEnabled(); |
23 | 23 |
24 // BackingStore implementation. | 24 // BackingStore implementation. |
25 virtual size_t MemorySize() OVERRIDE; | 25 virtual size_t MemorySize() OVERRIDE; |
26 virtual void PaintToBackingStore( | 26 virtual void PaintToBackingStore( |
27 RenderProcessHost* process, | 27 content::RenderProcessHost* process, |
28 TransportDIB::Id bitmap, | 28 TransportDIB::Id bitmap, |
29 const gfx::Rect& bitmap_rect, | 29 const gfx::Rect& bitmap_rect, |
30 const std::vector<gfx::Rect>& copy_rects, | 30 const std::vector<gfx::Rect>& copy_rects, |
31 const base::Closure& completion_callback, | 31 const base::Closure& completion_callback, |
32 bool* scheduled_completion_callback) OVERRIDE; | 32 bool* scheduled_completion_callback) OVERRIDE; |
33 virtual bool CopyFromBackingStore(const gfx::Rect& rect, | 33 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
34 skia::PlatformCanvas* output) OVERRIDE; | 34 skia::PlatformCanvas* output) OVERRIDE; |
35 virtual void ScrollBackingStore(int dx, int dy, | 35 virtual void ScrollBackingStore(int dx, int dy, |
36 const gfx::Rect& clip_rect, | 36 const gfx::Rect& clip_rect, |
37 const gfx::Size& view_size) OVERRIDE; | 37 const gfx::Size& view_size) OVERRIDE; |
38 | 38 |
39 private: | 39 private: |
40 // The backing store dc. | 40 // The backing store dc. |
41 HDC hdc_; | 41 HDC hdc_; |
42 | 42 |
43 // Handle to the backing store dib. | 43 // Handle to the backing store dib. |
44 HANDLE backing_store_dib_; | 44 HANDLE backing_store_dib_; |
45 | 45 |
46 // Handle to the original bitmap in the dc. | 46 // Handle to the original bitmap in the dc. |
47 HANDLE original_bitmap_; | 47 HANDLE original_bitmap_; |
48 | 48 |
49 // Number of bits per pixel of the screen. | 49 // Number of bits per pixel of the screen. |
50 int color_depth_; | 50 int color_depth_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(BackingStoreWin); | 52 DISALLOW_COPY_AND_ASSIGN(BackingStoreWin); |
53 }; | 53 }; |
54 | 54 |
55 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_ | 55 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_ |
OLD | NEW |