| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 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 CHROME_GPU_GPU_BACKING_STORE_WIN_H_ | |
| 6 #define CHROME_GPU_GPU_BACKING_STORE_WIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <windows.h> | |
| 10 | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "app/surface/transport_dib.h" | |
| 14 #include "base/basictypes.h" | |
| 15 #include "gfx/native_widget_types.h" | |
| 16 #include "gfx/size.h" | |
| 17 #include "ipc/ipc_channel.h" | |
| 18 | |
| 19 class GpuThread; | |
| 20 class GpuViewWin; | |
| 21 | |
| 22 namespace gfx { | |
| 23 class Rect; | |
| 24 class Size; | |
| 25 } | |
| 26 | |
| 27 class GpuBackingStoreWin : public IPC::Channel::Listener { | |
| 28 public: | |
| 29 GpuBackingStoreWin(GpuViewWin* view, | |
| 30 GpuThread* gpu_thread, | |
| 31 int32 routing_id, | |
| 32 const gfx::Size& size); | |
| 33 ~GpuBackingStoreWin(); | |
| 34 | |
| 35 gfx::Size size() const { return size_; } | |
| 36 HDC hdc() const { return hdc_; } | |
| 37 | |
| 38 // IPC::Channel::Listener implementation. | |
| 39 virtual void OnMessageReceived(const IPC::Message& message); | |
| 40 virtual void OnChannelConnected(int32 peer_pid); | |
| 41 virtual void OnChannelError(); | |
| 42 | |
| 43 private: | |
| 44 // Message handlers. | |
| 45 void OnPaintToBackingStore(base::ProcessId source_process_id, | |
| 46 TransportDIB::Id id, | |
| 47 const gfx::Rect& bitmap_rect, | |
| 48 const std::vector<gfx::Rect>& copy_rects); | |
| 49 void OnScrollBackingStore(int dx, int dy, | |
| 50 const gfx::Rect& clip_rect, | |
| 51 const gfx::Size& view_size); | |
| 52 | |
| 53 GpuViewWin* view_; | |
| 54 | |
| 55 GpuThread* gpu_thread_; | |
| 56 int32 routing_id_; | |
| 57 | |
| 58 gfx::Size size_; | |
| 59 | |
| 60 // The backing store dc. | |
| 61 HDC hdc_; | |
| 62 | |
| 63 // Handle to the backing store dib. | |
| 64 HANDLE backing_store_dib_; | |
| 65 | |
| 66 // Handle to the original bitmap in the dc. | |
| 67 HANDLE original_bitmap_; | |
| 68 | |
| 69 // Number of bits per pixel of the screen. | |
| 70 int color_depth_; | |
| 71 | |
| 72 DISALLOW_COPY_AND_ASSIGN(GpuBackingStoreWin); | |
| 73 }; | |
| 74 | |
| 75 #endif // CHROME_GPU_GPU_BACKING_STORE_WIN_H_ | |
| OLD | NEW |