IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / renderer_host / backing_store_aura.h
blob0b8e0729d0e937edcd1a561f432e03c029fd8724
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_AURA_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/backing_store.h"
10 #include "content/common/content_export.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
13 class SkCanvas;
15 namespace gfx {
16 class Point;
17 class Canvas;
20 namespace content {
21 class RenderProcessHost;
23 // A backing store that uses skia. This is the backing store used by
24 // RenderWidgetHostViewAura.
25 class BackingStoreAura : public BackingStore {
26 public:
27 CONTENT_EXPORT BackingStoreAura(
28 RenderWidgetHost* widget,
29 const gfx::Size& size);
31 virtual ~BackingStoreAura();
33 CONTENT_EXPORT void SkiaShowRect(const gfx::Point& point,
34 gfx::Canvas* canvas);
36 // Called when the view's backing scale factor changes.
37 void ScaleFactorChanged(float device_scale_factor);
39 // BackingStore implementation.
40 virtual size_t MemorySize() OVERRIDE;
41 virtual void PaintToBackingStore(
42 RenderProcessHost* process,
43 TransportDIB::Id bitmap,
44 const gfx::Rect& bitmap_rect,
45 const std::vector<gfx::Rect>& copy_rects,
46 float scale_factor,
47 const base::Closure& completion_callback,
48 bool* scheduled_completion_callback) OVERRIDE;
49 virtual bool CopyFromBackingStore(const gfx::Rect& rect,
50 skia::PlatformBitmap* output) OVERRIDE;
51 virtual void ScrollBackingStore(const gfx::Vector2d& delta,
52 const gfx::Rect& clip_rect,
53 const gfx::Size& view_size) OVERRIDE;
55 private:
56 SkBitmap bitmap_;
58 scoped_ptr<SkCanvas> canvas_;
59 float device_scale_factor_;
61 DISALLOW_COPY_AND_ASSIGN(BackingStoreAura);
64 } // namespace content
66 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_AURA_H_