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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ImageResource.cpp

Issue 1653673002: Even more explicit LayoutUnit conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moarConstructors
Patch Set: address comments Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 if (sizeType == IntrinsicCorrectedToDPR && m_hasDevicePixelRatioHeaderValue && m_devicePixelRatioHeaderValue > 0) 222 if (sizeType == IntrinsicCorrectedToDPR && m_hasDevicePixelRatioHeaderValue && m_devicePixelRatioHeaderValue > 0)
223 multiplier = 1.0 / m_devicePixelRatioHeaderValue; 223 multiplier = 1.0 / m_devicePixelRatioHeaderValue;
224 224
225 if (multiplier == 1.0f) 225 if (multiplier == 1.0f)
226 return size; 226 return size;
227 227
228 // Don't let images that have a width/height >= 1 shrink below 1 when zoomed . 228 // Don't let images that have a width/height >= 1 shrink below 1 when zoomed .
229 float widthScale = m_image->hasRelativeSize() ? 1.0f : multiplier; 229 float widthScale = m_image->hasRelativeSize() ? 1.0f : multiplier;
230 float heightScale = m_image->hasRelativeSize() ? 1.0f : multiplier; 230 float heightScale = m_image->hasRelativeSize() ? 1.0f : multiplier;
231 LayoutSize minimumSize(size.width() > 0 ? 1 : 0, size.height() > 0 ? 1 : 0); 231 LayoutSize minimumSize(size.width() > LayoutUnit() ? LayoutUnit(1) : LayoutU nit(),
232 LayoutUnit(size.height() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit())) ;
232 size.scale(widthScale, heightScale); 233 size.scale(widthScale, heightScale);
233 size.clampToMinimumSize(minimumSize); 234 size.clampToMinimumSize(minimumSize);
234 ASSERT(multiplier != 1.0f || (size.width().fraction() == 0.0f && size.height ().fraction() == 0.0f)); 235 ASSERT(multiplier != 1.0f || (size.width().fraction() == 0.0f && size.height ().fraction() == 0.0f));
235 return size; 236 return size;
236 } 237 }
237 238
238 void ImageResource::computeIntrinsicDimensions(Length& intrinsicWidth, Length& i ntrinsicHeight, FloatSize& intrinsicRatio) 239 void ImageResource::computeIntrinsicDimensions(Length& intrinsicWidth, Length& i ntrinsicHeight, FloatSize& intrinsicRatio)
239 { 240 {
240 if (m_image) 241 if (m_image)
241 m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, int rinsicRatio); 242 m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, int rinsicRatio);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 return true; 447 return true;
447 return !securityOrigin->taintsCanvas(response().url()); 448 return !securityOrigin->taintsCanvas(response().url());
448 } 449 }
449 450
450 bool ImageResource::loadingMultipartContent() const 451 bool ImageResource::loadingMultipartContent() const
451 { 452 {
452 return m_loader && m_loader->loadingMultipartContent(); 453 return m_loader && m_loader->loadingMultipartContent();
453 } 454 }
454 455
455 } // namespace blink 456 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698