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

Unified Diff: chrome/browser/renderer_host/backing_store_mac.cc

Issue 108040: Send array of paint rects and bitmaps as opposed to a Union (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/backing_store_mac.cc
===================================================================
--- chrome/browser/renderer_host/backing_store_mac.cc (revision 17347)
+++ chrome/browser/renderer_host/backing_store_mac.cc (working copy)
@@ -21,14 +21,24 @@
void BackingStore::PaintRect(base::ProcessHandle process,
TransportDIB* bitmap,
- const gfx::Rect& bitmap_rect) {
+ const gfx::Rect& bitmap_rect,
+ const gfx::Rect& paint_rect) {
+ DCHECK(bitmap_rect.Contains(paint_rect) &&
+ paint_rect.x() < kMaxBitmapLengthAllowed &&
+ paint_rect.y() < kMaxBitmapLengthAllowed);
SkBitmap skbitmap;
skbitmap.setConfig(SkBitmap::kARGB_8888_Config, bitmap_rect.width(),
bitmap_rect.height(), 4 * bitmap_rect.width());
skbitmap.setPixels(bitmap->memory());
-
- canvas_.drawBitmap(skbitmap, bitmap_rect.x(), bitmap_rect.y());
+ SkIRect src_rect;
+ src_rect.set(paint_rect.x(), paint_rect.y(),
+ paint_rect.right(), paint_rect.bottom());
+ src_rect.offset(-bitmap_rect.x(), -bitmap_rect.y());
+ SkRect dst_rect;
+ dst_rect.iset(paint_rect.x(), paint_rect.y(),
+ paint_rect.right(), paint_rect.bottom());
+ canvas_.drawBitmapRect(skbitmap, &src_rect, dst_rect);
}
void BackingStore::ScrollRect(base::ProcessHandle process,
@@ -117,6 +127,6 @@
}
// Now paint the new bitmap data.
- PaintRect(process, bitmap, bitmap_rect);
+ PaintRect(process, bitmap, bitmap_rect, bitmap_rect);
return;
}

Powered by Google App Engine
This is Rietveld 408576698