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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_backing_store.h

Issue 10830072: Browser Plugin: New Implementation (Renderer Side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
(Empty)
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.
4
5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BACKING_STORE_H__
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BACKING_STORE_H__
7
8 #include <vector>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "ui/gfx/size.h"
13
14 class SkCanvas;
15 class TransportDIB;
16
17 namespace gfx {
18 class Canvas;
19 class Point;
20 class Rect;
21 }
22
23 // The BrowserPluginBackingStore is a wrapper around an SkBitmap that is used
24 // in the software rendering path of the browser plugin. The backing store has
25 // two write operations:
26 // 1. PaintToBackingStore copies pixel regions to the bitmap.
27 // 2. ScrollBackingStore scrolls a region of the bitmap by dx, and dy.
28 // These are called in response to changes in the guest relayed via
29 // BrowserPluginMsg_UpdateRect. See BrowserPlugin::UpdateRect.
30 class BrowserPluginBackingStore {
31 public:
32 BrowserPluginBackingStore(const gfx::Size& size);
33 virtual ~BrowserPluginBackingStore();
34
35 void PaintToBackingStore(
36 const gfx::Rect& bitmap_rect,
37 const std::vector<gfx::Rect>& copy_rects,
38 TransportDIB* dib);
39
40 void ScrollBackingStore(int dx,
41 int dy,
42 const gfx::Rect& clip_rect,
43 const gfx::Size& view_size);
44
45 const gfx::Size& GetSize() const { return size_; }
46
47 const SkBitmap& GetBitmap() const { return bitmap_; }
48
49 private:
50 gfx::Size size_;
51 SkBitmap bitmap_;
52 scoped_ptr<SkCanvas> canvas_;
53
54 DISALLOW_COPY_AND_ASSIGN(BrowserPluginBackingStore);
55 };
56
57 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BACKING_STORE_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698