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

Side by Side Diff: Source/web/PageWidgetDelegate.cpp

Issue 725043002: Remove GraphicsContext::applyDeviceScaleFactor() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: typo Created 6 years, 1 month 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
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/web/WebPopupMenuImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 { 60 {
61 page.animator().updateLayoutAndStyleForPainting(&root); 61 page.animator().updateLayoutAndStyleForPainting(&root);
62 } 62 }
63 63
64 void PageWidgetDelegate::paint(Page& page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background, LocalFrame& root) 64 void PageWidgetDelegate::paint(Page& page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background, LocalFrame& root)
65 { 65 {
66 if (rect.isEmpty()) 66 if (rect.isEmpty())
67 return; 67 return;
68 GraphicsContext gc(canvas); 68 GraphicsContext gc(canvas);
69 gc.setCertainlyOpaque(background == Opaque); 69 gc.setCertainlyOpaque(background == Opaque);
70 gc.applyDeviceScaleFactor(page.deviceScaleFactor()); 70 float scaleFactor = page.deviceScaleFactor();
71 gc.setDeviceScaleFactor(page.deviceScaleFactor()); 71 gc.scale(scaleFactor, scaleFactor);
72 gc.setDeviceScaleFactor(scaleFactor);
72 IntRect dirtyRect(rect); 73 IntRect dirtyRect(rect);
73 gc.save(); // Needed to save the canvas, not the GraphicsContext. 74 gc.save(); // Needed to save the canvas, not the GraphicsContext.
74 FrameView* view = root.view(); 75 FrameView* view = root.view();
75 if (view) { 76 if (view) {
76 gc.clip(dirtyRect); 77 gc.clip(dirtyRect);
77 view->paint(&gc, dirtyRect); 78 view->paint(&gc, dirtyRect);
78 if (overlays) 79 if (overlays)
79 overlays->paintWebFrame(gc); 80 overlays->paintWebFrame(gc);
80 } else { 81 } else {
81 gc.fillRect(dirtyRect, Color::white); 82 gc.fillRect(dirtyRect, Color::white);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 { 191 {
191 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); 192 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event));
192 } 193 }
193 194
194 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event) 195 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event)
195 { 196 {
196 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); 197 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event));
197 } 198 }
198 199
199 } // namespace blink 200 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/web/WebPopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698