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

Unified Diff: content/browser/renderer_host/backing_store_win.cc

Issue 11967033: [CLOSED] In-browser software compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the lack SkCanvas::clear scissoring. Created 7 years, 11 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
« no previous file with comments | « cc/test/fake_software_output_device.cc ('k') | content/browser/renderer_host/image_transport_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/backing_store_win.cc
diff --git a/content/browser/renderer_host/backing_store_win.cc b/content/browser/renderer_host/backing_store_win.cc
index c9ce07a86bb51564fb08af9a96ac05132395fe6e..e1ceb2a0ed6a4fbbde77131042e2e2e1ccc6fb0a 100644
--- a/content/browser/renderer_host/backing_store_win.cc
+++ b/content/browser/renderer_host/backing_store_win.cc
@@ -46,29 +46,6 @@ HANDLE CreateDIB(HDC dc, int width, int height, int color_depth) {
return dib;
}
-void CallStretchDIBits(HDC hdc, int dest_x, int dest_y, int dest_w, int dest_h,
- int src_x, int src_y, int src_w, int src_h, void* pixels,
- const BITMAPINFO* bitmap_info) {
- // When blitting a rectangle that touches the bottom, left corner of the
- // bitmap, StretchDIBits looks at it top-down! For more details, see
- // http://wiki.allegro.cc/index.php?title=StretchDIBits.
- int rv;
- int bitmap_h = -bitmap_info->bmiHeader.biHeight;
- int bottom_up_src_y = bitmap_h - src_y - src_h;
- if (bottom_up_src_y == 0 && src_x == 0 && src_h != bitmap_h) {
- rv = StretchDIBits(hdc,
- dest_x, dest_h + dest_y - 1, dest_w, -dest_h,
- src_x, bitmap_h - src_y + 1, src_w, -src_h,
- pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY);
- } else {
- rv = StretchDIBits(hdc,
- dest_x, dest_y, dest_w, dest_h,
- src_x, bottom_up_src_y, src_w, src_h,
- pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY);
- }
- DCHECK(rv != GDI_ERROR);
-}
-
} // namespace
BackingStoreWin::BackingStoreWin(RenderWidgetHost* widget,
@@ -151,17 +128,17 @@ void BackingStoreWin::PaintToBackingStore(
gfx::Rect paint_rect = gfx::IntersectRects(view_rect, copy_rects[i]);
gfx::Rect pixel_copy_rect = gfx::ToEnclosedRect(
gfx::ScaleRect(paint_rect, scale_factor));
- CallStretchDIBits(hdc_,
- paint_rect.x(),
- paint_rect.y(),
- paint_rect.width(),
- paint_rect.height(),
- pixel_copy_rect.x() - pixel_bitmap_rect.x(),
- pixel_copy_rect.y() - pixel_bitmap_rect.y(),
- pixel_copy_rect.width(),
- pixel_copy_rect.height(),
- dib->memory(),
- reinterpret_cast<BITMAPINFO*>(&hdr));
+ gfx::StretchDIBits(hdc_,
+ paint_rect.x(),
+ paint_rect.y(),
+ paint_rect.width(),
+ paint_rect.height(),
+ pixel_copy_rect.x() - pixel_bitmap_rect.x(),
+ pixel_copy_rect.y() - pixel_bitmap_rect.y(),
+ pixel_copy_rect.width(),
+ pixel_copy_rect.height(),
+ dib->memory(),
+ reinterpret_cast<BITMAPINFO*>(&hdr));
}
}
« no previous file with comments | « cc/test/fake_software_output_device.cc ('k') | content/browser/renderer_host/image_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698