OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/renderer_host/backing_store.h" | 9 #include "chrome/browser/renderer_host/backing_store.h" |
10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
11 | 11 |
12 class GpuProcessHost; | 12 class GpuProcessHostUIShim; |
13 | 13 |
14 class BackingStoreProxy : public BackingStore, | 14 class BackingStoreProxy : public BackingStore, |
15 public IPC::Channel::Listener { | 15 public IPC::Channel::Listener { |
16 public: | 16 public: |
17 BackingStoreProxy(RenderWidgetHost* widget, const gfx::Size& size, | 17 BackingStoreProxy(RenderWidgetHost* widget, const gfx::Size& size, |
18 GpuProcessHost* process, int32 routing_id); | 18 GpuProcessHostUIShim* process_shim, int32 routing_id); |
19 virtual ~BackingStoreProxy(); | 19 virtual ~BackingStoreProxy(); |
20 | 20 |
21 // BackingStore implementation. | 21 // BackingStore implementation. |
22 virtual void PaintToBackingStore(RenderProcessHost* process, | 22 virtual void PaintToBackingStore(RenderProcessHost* process, |
23 TransportDIB::Id bitmap, | 23 TransportDIB::Id bitmap, |
24 const gfx::Rect& bitmap_rect, | 24 const gfx::Rect& bitmap_rect, |
25 const std::vector<gfx::Rect>& copy_rects, | 25 const std::vector<gfx::Rect>& copy_rects, |
26 bool* painted_synchronously); | 26 bool* painted_synchronously); |
27 virtual bool CopyFromBackingStore(const gfx::Rect& rect, | 27 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
28 skia::PlatformCanvas* output); | 28 skia::PlatformCanvas* output); |
29 virtual void ScrollBackingStore(int dx, int dy, | 29 virtual void ScrollBackingStore(int dx, int dy, |
30 const gfx::Rect& clip_rect, | 30 const gfx::Rect& clip_rect, |
31 const gfx::Size& view_size); | 31 const gfx::Size& view_size); |
32 | 32 |
33 // IPC::Channel::Listener implementation. | 33 // IPC::Channel::Listener implementation. |
34 virtual void OnMessageReceived(const IPC::Message& message); | 34 virtual void OnMessageReceived(const IPC::Message& message); |
35 virtual void OnChannelConnected(int32 peer_pid); | 35 virtual void OnChannelConnected(int32 peer_pid); |
36 virtual void OnChannelError(); | 36 virtual void OnChannelError(); |
37 | 37 |
38 private: | 38 private: |
39 // Message handlers. | 39 // Message handlers. |
40 void OnPaintToBackingStoreACK(); | 40 void OnPaintToBackingStoreACK(); |
41 | 41 |
42 GpuProcessHost* process_; | 42 GpuProcessHostUIShim* process_shim_; |
43 int32 routing_id_; | 43 int32 routing_id_; |
44 | 44 |
45 // Set to true when we're waiting for the GPU process to do a paint and send | 45 // Set to true when we're waiting for the GPU process to do a paint and send |
46 // back a "done" message. In this case, the renderer will be waiting for our | 46 // back a "done" message. In this case, the renderer will be waiting for our |
47 // message that we're done using the backing store. | 47 // message that we're done using the backing store. |
48 bool waiting_for_paint_ack_; | 48 bool waiting_for_paint_ack_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(BackingStoreProxy); | 50 DISALLOW_COPY_AND_ASSIGN(BackingStoreProxy); |
51 }; | 51 }; |
52 | 52 |
53 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_ | 53 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_ |
OLD | NEW |