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

Side by Side Diff: chrome/browser/renderer_host/backing_store_mac.cc

Issue 126101: Adds kind-of-live thumbnail generation for a potential tab switcher. (Closed)
Patch Set: For Checking hopefully Created 11 years, 6 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
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/backing_store.h ('k') | chrome/browser/renderer_host/backing_store_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698