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

Side by Side Diff: Source/core/frame/LocalFrame.cpp

Issue 1303453003: Incorrect LocalFrame::paintIntoDragImage picture bounds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 5 years, 4 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 const GlobalPaintFlags globalPaintFlags, IntRect paintingRect, float opacity ) 591 const GlobalPaintFlags globalPaintFlags, IntRect paintingRect, float opacity )
592 { 592 {
593 ASSERT(document()->isActive()); 593 ASSERT(document()->isActive());
594 // Not flattening compositing layers will result in a broken image being pai nted. 594 // Not flattening compositing layers will result in a broken image being pai nted.
595 ASSERT(globalPaintFlags & GlobalPaintFlattenCompositingLayers); 595 ASSERT(globalPaintFlags & GlobalPaintFlattenCompositingLayers);
596 596
597 float deviceScaleFactor = m_host->deviceScaleFactor(); 597 float deviceScaleFactor = m_host->deviceScaleFactor();
598 paintingRect.setWidth(paintingRect.width() * deviceScaleFactor); 598 paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
599 paintingRect.setHeight(paintingRect.height() * deviceScaleFactor); 599 paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
600 600
601 SkPictureBuilder pictureBuilder(paintingRect); 601 // The content is shifted to origin, to fit within the image bounds - which are the same
602 // as the picture bounds.
603 SkRect pictureBounds = SkRect::MakeIWH(paintingRect.width(), paintingRect.he ight());
604 SkPictureBuilder pictureBuilder(pictureBounds);
602 { 605 {
603 GraphicsContext& paintContext = pictureBuilder.context(); 606 GraphicsContext& paintContext = pictureBuilder.context();
604 607
605 AffineTransform transform; 608 AffineTransform transform;
606 transform.scale(deviceScaleFactor, deviceScaleFactor); 609 transform.scale(deviceScaleFactor, deviceScaleFactor);
607 transform.translate(-paintingRect.x(), -paintingRect.y()); 610 transform.translate(-paintingRect.x(), -paintingRect.y());
608 TransformRecorder transformRecorder(paintContext, displayItemClient, tra nsform); 611 TransformRecorder transformRecorder(paintContext, displayItemClient, tra nsform);
609 612
610 m_view->paintContents(&paintContext, globalPaintFlags, paintingRect); 613 m_view->paintContents(&paintContext, globalPaintFlags, paintingRect);
611 614
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 { 847 {
845 if (isLocalRoot()) 848 if (isLocalRoot())
846 m_instrumentingAgents = InstrumentingAgents::create(); 849 m_instrumentingAgents = InstrumentingAgents::create();
847 else 850 else
848 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; 851 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents;
849 } 852 }
850 853
851 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); 854 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
852 855
853 } // namespace blink 856 } // 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