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

Side by Side Diff: Source/core/rendering/style/FillLayer.cpp

Issue 275543003: Don't always fully repaint on viewport resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline 2 tests Created 6 years, 7 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 | « Source/core/rendering/style/FillLayer.h ('k') | Source/core/rendering/style/RenderStyle.h » ('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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 { 348 {
349 const FillLayer* curr; 349 const FillLayer* curr;
350 for (curr = this; curr; curr = curr->next()) { 350 for (curr = this; curr; curr = curr->next()) {
351 if (curr->m_image && !curr->m_image->isLoaded()) 351 if (curr->m_image && !curr->m_image->isLoaded())
352 return false; 352 return false;
353 } 353 }
354 354
355 return true; 355 return true;
356 } 356 }
357 357
358 bool FillLayer::needsFullRepaintOnContainerWidthChange() const
359 {
360 if (m_image) {
361 if (m_repeatX != RepeatFill && m_repeatX != NoRepeatFill)
362 return true;
363 if (m_xPosition.isPercent() && !m_xPosition.isZero())
364 return true;
365 if (m_backgroundXOrigin != LeftEdge)
366 return true;
367 if (m_sizeType != SizeLength && m_sizeType != SizeNone)
368 return true;
369 if (m_sizeType == SizeLength) {
370 if (m_sizeLength.width().isPercent() && !m_sizeLength.width().isZero ())
371 return true;
372 if (m_sizeLength.width().isAuto() && m_sizeLength.height().isPercent () && !m_sizeLength.height().isZero())
373 return true;
374 }
375 }
376
377 return m_next && m_next->needsFullRepaintOnContainerWidthChange();
378 }
379
380 bool FillLayer::needsFullRepaintOnContainerHeightChange() const
381 {
382 if (m_image) {
383 if (m_repeatY != RepeatFill && m_repeatY != NoRepeatFill)
384 return true;
385 if (m_yPosition.isPercent() && !m_yPosition.isZero())
386 return true;
387 if (m_backgroundYOrigin != TopEdge)
388 return true;
389 if (m_sizeType != SizeLength && m_sizeType != SizeNone)
390 return true;
391 if (m_sizeType == SizeLength) {
392 if (m_sizeLength.height().isPercent() && !m_sizeLength.height().isZe ro())
393 return true;
394 if (m_sizeLength.height().isAuto() && m_sizeLength.width().isPercent () && !m_sizeLength.width().isZero())
395 return true;
396 }
397 }
398
399 return m_next && m_next->needsFullRepaintOnContainerHeightChange();
400 }
401
358 bool FillLayer::hasOpaqueImage(const RenderObject* renderer) const 402 bool FillLayer::hasOpaqueImage(const RenderObject* renderer) const
359 { 403 {
360 if (!m_image) 404 if (!m_image)
361 return false; 405 return false;
362 406
363 if (m_composite == CompositeClear || m_composite == CompositeCopy) 407 if (m_composite == CompositeClear || m_composite == CompositeCopy)
364 return true; 408 return true;
365 409
366 if (m_blendMode != blink::WebBlendModeNormal) 410 if (m_blendMode != blink::WebBlendModeNormal)
367 return false; 411 return false;
368 412
369 if (m_composite == CompositeSourceOver) 413 if (m_composite == CompositeSourceOver)
370 return m_image->knownToBeOpaque(renderer); 414 return m_image->knownToBeOpaque(renderer);
371 415
372 return false; 416 return false;
373 } 417 }
374 418
375 bool FillLayer::hasRepeatXY() const 419 bool FillLayer::hasRepeatXY() const
376 { 420 {
377 return m_repeatX == RepeatFill && m_repeatY == RepeatFill; 421 return m_repeatX == RepeatFill && m_repeatY == RepeatFill;
378 } 422 }
379 423
380 } // namespace WebCore 424 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/style/FillLayer.h ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698