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

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

Issue 1327503002: [DevTools] Set correct overlay size for scaled page. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentI mpl()) 84 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentI mpl())
85 devTools->willAddPageOverlay(m_layer.get()); 85 devTools->willAddPageOverlay(m_layer.get());
86 86
87 // This is required for contents of overlay to stay in sync with the pag e while scrolling. 87 // This is required for contents of overlay to stay in sync with the pag e while scrolling.
88 WebLayer* platformLayer = m_layer->platformLayer(); 88 WebLayer* platformLayer = m_layer->platformLayer();
89 platformLayer->setShouldScrollOnMainThread(true); 89 platformLayer->setShouldScrollOnMainThread(true);
90 page->frameHost().visualViewport().containerLayer()->addChild(m_layer.ge t()); 90 page->frameHost().visualViewport().containerLayer()->addChild(m_layer.ge t());
91 } 91 }
92 92
93 FloatSize size = page->frameHost().visualViewport().visibleSize(); 93 FloatSize size = page->frameHost().visualViewport().size();
94 if (size != m_layer->size()) 94 if (size != m_layer->size())
95 m_layer->setSize(size); 95 m_layer->setSize(size);
96 96
97 m_layer->setNeedsDisplay(); 97 m_layer->setNeedsDisplay();
98 } 98 }
99 99
100 void PageOverlay::paintContents(const GraphicsLayer*, GraphicsContext& gc, Graph icsLayerPaintingPhase, const IntRect& inClip) 100 void PageOverlay::paintContents(const GraphicsLayer*, GraphicsContext& gc, Graph icsLayerPaintingPhase, const IntRect& inClip)
101 { 101 {
102 ASSERT(m_layer); 102 ASSERT(m_layer);
103 WebGraphicsContextImpl contextWrapper(gc, *this, DisplayItem::PageOverlay); 103 WebGraphicsContextImpl contextWrapper(gc, *this, DisplayItem::PageOverlay);
104 m_delegate->paintPageOverlay(&contextWrapper, expandedIntSize(m_layer->size( ))); 104 m_delegate->paintPageOverlay(&contextWrapper, expandedIntSize(m_layer->size( )));
105 } 105 }
106 106
107 String PageOverlay::debugName(const GraphicsLayer*) 107 String PageOverlay::debugName(const GraphicsLayer*)
108 { 108 {
109 return "WebViewImpl Page Overlay Content Layer"; 109 return "WebViewImpl Page Overlay Content Layer";
110 } 110 }
111 111
112 } // namespace blink 112 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698