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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "content/browser/renderer_host/backing_store.h"
16 class BackingStoreWin
: public BackingStore
{
18 BackingStoreWin(RenderWidgetHost
* widget
, const gfx::Size
& size
);
19 virtual ~BackingStoreWin();
21 HDC
hdc() { return hdc_
; }
23 // Returns true if we should convert to the monitor profile when painting.
24 static bool ColorManagementEnabled();
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
,
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
;
43 // The backing store dc.
46 // Handle to the backing store dib.
47 HANDLE backing_store_dib_
;
49 // Handle to the original bitmap in the dc.
50 HANDLE original_bitmap_
;
52 // Number of bits per pixel of the screen.
55 DISALLOW_COPY_AND_ASSIGN(BackingStoreWin
);
58 } // namespace content
60 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_WIN_H_