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