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

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

Issue 12340015: [CLOSED] Big patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/software_renderer.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 77c03412805df0ef30561e8aade65f56a4c36ea8..ec8b964b30bb8187d426ab5e769c129591888eee 100644
--- a/content/browser/renderer_host/backing_store_win.cc
+++ b/content/browser/renderer_host/backing_store_win.cc
@@ -48,29 +48,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,
@@ -160,17 +137,17 @@ void BackingStoreWin::PaintToBackingStore(
gfx::Rect pixel_copy_rect = gfx::ToEnclosingRect(
gfx::ScaleRect(paint_rect, scale_factor));
gfx::Rect target_rect = pixel_copy_rect;
- CallStretchDIBits(hdc_,
- target_rect.x(),
- target_rect.y(),
- target_rect.width(),
- target_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_,
+ target_rect.x(),
+ target_rect.y(),
+ target_rect.width(),
+ target_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/software_renderer.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