OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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_SKIA_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/renderer_host/backing_store.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 |
| 13 class SkCanvas; |
| 14 |
| 15 namespace gfx { |
| 16 class Point; |
| 17 class Canvas; |
| 18 } |
| 19 |
| 20 // A backing store that uses skia. |
| 21 class BackingStoreSkia : public BackingStore { |
| 22 public: |
| 23 BackingStoreSkia(RenderWidgetHost* widget, const gfx::Size& size); |
| 24 virtual ~BackingStoreSkia(); |
| 25 |
| 26 void SkiaShowRect(const gfx::Point& point, gfx::Canvas* canvas); |
| 27 |
| 28 // BackingStore implementation. |
| 29 virtual size_t MemorySize(); |
| 30 virtual void PaintToBackingStore( |
| 31 RenderProcessHost* process, |
| 32 TransportDIB::Id bitmap, |
| 33 const gfx::Rect& bitmap_rect, |
| 34 const std::vector<gfx::Rect>& copy_rects); |
| 35 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
| 36 skia::PlatformCanvas* output); |
| 37 virtual void ScrollBackingStore(int dx, int dy, |
| 38 const gfx::Rect& clip_rect, |
| 39 const gfx::Size& view_size); |
| 40 |
| 41 private: |
| 42 SkBitmap bitmap_; |
| 43 |
| 44 scoped_ptr<SkCanvas> canvas_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(BackingStoreSkia); |
| 47 }; |
| 48 |
| 49 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ |
OLD | NEW |