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