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

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

Issue 131002: Enable off-by-default monitor color management on Windows. This is enabled vi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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 | Annotate | Revision Log
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/render_widget_host_view_win.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/l10n_util_win.h" 9 #include "app/l10n_util_win.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 if (damaged_rect.IsEmpty()) 704 if (damaged_rect.IsEmpty())
705 return; 705 return;
706 706
707 if (backing_store) { 707 if (backing_store) {
708 gfx::Rect bitmap_rect( 708 gfx::Rect bitmap_rect(
709 0, 0, backing_store->size().width(), backing_store->size().height()); 709 0, 0, backing_store->size().width(), backing_store->size().height());
710 710
711 gfx::Rect paint_rect = bitmap_rect.Intersect(damaged_rect); 711 gfx::Rect paint_rect = bitmap_rect.Intersect(damaged_rect);
712 if (!paint_rect.IsEmpty()) { 712 if (!paint_rect.IsEmpty()) {
713 DrawResizeCorner(paint_rect, backing_store->hdc()); 713 DrawResizeCorner(paint_rect, backing_store->hdc());
714 bool manage_colors = BackingStore::ColorManagementEnabled();
715 if (manage_colors)
716 SetICMMode(paint_dc.m_hDC, ICM_ON);
714 BitBlt(paint_dc.m_hDC, 717 BitBlt(paint_dc.m_hDC,
715 paint_rect.x(), 718 paint_rect.x(),
716 paint_rect.y(), 719 paint_rect.y(),
717 paint_rect.width(), 720 paint_rect.width(),
718 paint_rect.height(), 721 paint_rect.height(),
719 backing_store->hdc(), 722 backing_store->hdc(),
720 paint_rect.x(), 723 paint_rect.x(),
721 paint_rect.y(), 724 paint_rect.y(),
722 SRCCOPY); 725 SRCCOPY);
726 if (manage_colors)
727 SetICMMode(paint_dc.m_hDC, ICM_OFF);
723 } 728 }
724 729
725 // Fill the remaining portion of the damaged_rect with the background 730 // Fill the remaining portion of the damaged_rect with the background
726 if (damaged_rect.right() > bitmap_rect.right()) { 731 if (damaged_rect.right() > bitmap_rect.right()) {
727 RECT r; 732 RECT r;
728 r.left = std::max(bitmap_rect.right(), damaged_rect.x()); 733 r.left = std::max(bitmap_rect.right(), damaged_rect.x());
729 r.right = damaged_rect.right(); 734 r.right = damaged_rect.right();
730 r.top = damaged_rect.y(); 735 r.top = damaged_rect.y();
731 r.bottom = std::min(bitmap_rect.bottom(), damaged_rect.bottom()); 736 r.bottom = std::min(bitmap_rect.bottom(), damaged_rect.bottom());
732 DrawBackground(r, &paint_dc); 737 DrawBackground(r, &paint_dc);
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 // WM_LBUTTONDOWN. 1318 // WM_LBUTTONDOWN.
1314 SetFocus(); 1319 SetFocus();
1315 } 1320 }
1316 } 1321 }
1317 1322
1318 void RenderWidgetHostViewWin::ShutdownHost() { 1323 void RenderWidgetHostViewWin::ShutdownHost() {
1319 shutdown_factory_.RevokeAll(); 1324 shutdown_factory_.RevokeAll();
1320 render_widget_host_->Shutdown(); 1325 render_widget_host_->Shutdown();
1321 // Do not touch any members at this point, |this| has been deleted. 1326 // Do not touch any members at this point, |this| has been deleted.
1322 } 1327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698