OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/renderer_host/backing_store.h" | 5 #include "chrome/browser/renderer_host/backing_store.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/common/transport_dib.h" | 8 #include "chrome/common/transport_dib.h" |
9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
11 #include "third_party/skia/include/core/SkCanvas.h" | 11 #include "third_party/skia/include/core/SkCanvas.h" |
12 | 12 |
13 BackingStore::BackingStore(const gfx::Size& size) | 13 BackingStore::BackingStore(RenderWidgetHost* widget, const gfx::Size& size) |
14 : size_(size) { | 14 : render_widget_host_(widget), |
| 15 size_(size) { |
15 if (!canvas_.initialize(size.width(), size.height(), true)) | 16 if (!canvas_.initialize(size.width(), size.height(), true)) |
16 SK_CRASH(); | 17 SK_CRASH(); |
17 } | 18 } |
18 | 19 |
19 BackingStore::~BackingStore() { | 20 BackingStore::~BackingStore() { |
20 } | 21 } |
21 | 22 |
22 void BackingStore::PaintRect(base::ProcessHandle process, | 23 void BackingStore::PaintRect(base::ProcessHandle process, |
23 TransportDIB* bitmap, | 24 TransportDIB* bitmap, |
24 const gfx::Rect& bitmap_rect) { | 25 const gfx::Rect& bitmap_rect) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 memcpy(x, x + stride * dy, len); | 115 memcpy(x, x + stride * dy, len); |
115 x -= stride; | 116 x -= stride; |
116 } | 117 } |
117 } | 118 } |
118 } | 119 } |
119 | 120 |
120 // Now paint the new bitmap data. | 121 // Now paint the new bitmap data. |
121 PaintRect(process, bitmap, bitmap_rect); | 122 PaintRect(process, bitmap, bitmap_rect); |
122 return; | 123 return; |
123 } | 124 } |
OLD | NEW |