Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: content/browser/renderer_host/backing_store.h

Issue 11031055: Introduce PlatformBitmap, which is a minimal helper class that wraps an SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 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_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "ui/gfx/size.h" 13 #include "ui/gfx/size.h"
14 #include "ui/surface/transport_dib.h" 14 #include "ui/surface/transport_dib.h"
15 15
16 class RenderProcessHost; 16 class RenderProcessHost;
17 17
18 namespace gfx { 18 namespace gfx {
19 class Rect; 19 class Rect;
20 } 20 }
21 21
22 namespace skia { 22 namespace skia {
23 class PlatformCanvas; 23 class PlatformBitmap;
24 } 24 }
25 25
26 namespace content { 26 namespace content {
27 class RenderProcessHost; 27 class RenderProcessHost;
28 class RenderWidgetHost; 28 class RenderWidgetHost;
29 29
30 // Represents a backing store for the pixels in a RenderWidgetHost. 30 // Represents a backing store for the pixels in a RenderWidgetHost.
31 class CONTENT_EXPORT BackingStore { 31 class CONTENT_EXPORT BackingStore {
32 public: 32 public:
33 virtual ~BackingStore(); 33 virtual ~BackingStore();
(...skipping 25 matching lines...) Expand all
59 const std::vector<gfx::Rect>& copy_rects, 59 const std::vector<gfx::Rect>& copy_rects,
60 float scale_factor, 60 float scale_factor,
61 const base::Closure& completion_callback, 61 const base::Closure& completion_callback,
62 bool* scheduled_completion_callback) = 0; 62 bool* scheduled_completion_callback) = 0;
63 63
64 // Extracts the gives subset of the backing store and copies it to the given 64 // Extracts the gives subset of the backing store and copies it to the given
65 // PlatformCanvas. The PlatformCanvas should not be initialized. This function 65 // PlatformCanvas. The PlatformCanvas should not be initialized. This function
66 // will call initialize() with the correct size. The return value indicates 66 // will call initialize() with the correct size. The return value indicates
67 // success. 67 // success.
68 virtual bool CopyFromBackingStore(const gfx::Rect& rect, 68 virtual bool CopyFromBackingStore(const gfx::Rect& rect,
69 skia::PlatformCanvas* output) = 0; 69 skia::PlatformBitmap* output) = 0;
70 70
71 // Scrolls the contents of clip_rect in the backing store by dx or dy (but dx 71 // Scrolls the contents of clip_rect in the backing store by dx or dy (but dx
72 // and dy cannot both be non-zero). 72 // and dy cannot both be non-zero).
73 virtual void ScrollBackingStore(int dx, int dy, 73 virtual void ScrollBackingStore(int dx, int dy,
74 const gfx::Rect& clip_rect, 74 const gfx::Rect& clip_rect,
75 const gfx::Size& view_size) = 0; 75 const gfx::Size& view_size) = 0;
76 protected: 76 protected:
77 // Can only be constructed via subclasses. 77 // Can only be constructed via subclasses.
78 BackingStore(RenderWidgetHost* widget, const gfx::Size& size); 78 BackingStore(RenderWidgetHost* widget, const gfx::Size& size);
79 79
80 private: 80 private:
81 // The owner of this backing store. 81 // The owner of this backing store.
82 RenderWidgetHost* render_widget_host_; 82 RenderWidgetHost* render_widget_host_;
83 83
84 // The size of the backing store. 84 // The size of the backing store.
85 gfx::Size size_; 85 gfx::Size size_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(BackingStore); 87 DISALLOW_COPY_AND_ASSIGN(BackingStore);
88 }; 88 };
89 89
90 } // namespace content 90 } // namespace content
91 91
92 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ 92 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_
OLDNEW
« no previous file with comments | « chrome/browser/thumbnails/thumbnail_tab_helper.cc ('k') | content/browser/renderer_host/backing_store_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698