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