| OLD | NEW |
| 1 // Copyright (c) 2011 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_SKIA_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/renderer_host/backing_store.h" | 10 #include "content/browser/renderer_host/backing_store.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
| 13 | 13 |
| 14 class SkCanvas; | 14 class SkCanvas; |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Point; | 17 class Point; |
| 18 class Canvas; | 18 class CanvasSkia; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 class RenderProcessHost; | 22 class RenderProcessHost; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // A backing store that uses skia. This is a temporary backing store used by | 25 // A backing store that uses skia. This is a temporary backing store used by |
| 26 // RenderWidgetHostViewViews. In time, only GPU rendering will be used for | 26 // RenderWidgetHostViewViews. In time, only GPU rendering will be used for |
| 27 // RWHVV, and then this backing store will be removed. | 27 // RWHVV, and then this backing store will be removed. |
| 28 class BackingStoreSkia : public BackingStore { | 28 class BackingStoreSkia : public BackingStore { |
| 29 public: | 29 public: |
| 30 CONTENT_EXPORT BackingStoreSkia( | 30 CONTENT_EXPORT BackingStoreSkia( |
| 31 RenderWidgetHost* widget, | 31 RenderWidgetHost* widget, |
| 32 const gfx::Size& size); | 32 const gfx::Size& size); |
| 33 | 33 |
| 34 virtual ~BackingStoreSkia(); | 34 virtual ~BackingStoreSkia(); |
| 35 | 35 |
| 36 CONTENT_EXPORT void SkiaShowRect(const gfx::Point& point, | 36 CONTENT_EXPORT void SkiaShowRect(const gfx::Point& point, |
| 37 gfx::Canvas* canvas); | 37 gfx::CanvasSkia* canvas); |
| 38 | 38 |
| 39 // BackingStore implementation. | 39 // BackingStore implementation. |
| 40 virtual size_t MemorySize() OVERRIDE; | 40 virtual size_t MemorySize() OVERRIDE; |
| 41 virtual void PaintToBackingStore( | 41 virtual void PaintToBackingStore( |
| 42 content::RenderProcessHost* process, | 42 content::RenderProcessHost* process, |
| 43 TransportDIB::Id bitmap, | 43 TransportDIB::Id bitmap, |
| 44 const gfx::Rect& bitmap_rect, | 44 const gfx::Rect& bitmap_rect, |
| 45 const std::vector<gfx::Rect>& copy_rects, | 45 const std::vector<gfx::Rect>& copy_rects, |
| 46 const base::Closure& completion_callback, | 46 const base::Closure& completion_callback, |
| 47 bool* scheduled_completion_callback) OVERRIDE; | 47 bool* scheduled_completion_callback) OVERRIDE; |
| 48 virtual bool CopyFromBackingStore(const gfx::Rect& rect, | 48 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
| 49 skia::PlatformCanvas* output) OVERRIDE; | 49 skia::PlatformCanvas* output) OVERRIDE; |
| 50 virtual void ScrollBackingStore(int dx, int dy, | 50 virtual void ScrollBackingStore(int dx, int dy, |
| 51 const gfx::Rect& clip_rect, | 51 const gfx::Rect& clip_rect, |
| 52 const gfx::Size& view_size) OVERRIDE; | 52 const gfx::Size& view_size) OVERRIDE; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 SkBitmap bitmap_; | 55 SkBitmap bitmap_; |
| 56 | 56 |
| 57 scoped_ptr<SkCanvas> canvas_; | 57 scoped_ptr<SkCanvas> canvas_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(BackingStoreSkia); | 59 DISALLOW_COPY_AND_ASSIGN(BackingStoreSkia); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ | 62 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ |
| OLD | NEW |