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

Side by Side Diff: third_party/WebKit/Source/core/style/FillLayer.cpp

Issue 2068723002: Paint local attachment backgrounds into composited scrolling contents layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add/update tests and simplify added code. Created 4 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
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 for (FillLayer* p = this; p; p = next) { 309 for (FillLayer* p = this; p; p = next) {
310 next = p->m_next; 310 next = p->m_next;
311 if (next && !next->isImageSet()) { 311 if (next && !next->isImageSet()) {
312 delete next; 312 delete next;
313 p->m_next = 0; 313 p->m_next = 0;
314 break; 314 break;
315 } 315 }
316 } 316 }
317 } 317 }
318 318
319 static EFillBox clipMax(EFillBox clipA, EFillBox clipB)
320 {
321 if (clipA == BorderFillBox || clipB == BorderFillBox)
322 return BorderFillBox;
323 if (clipA == PaddingFillBox || clipB == PaddingFillBox)
324 return PaddingFillBox;
325 if (clipA == ContentFillBox || clipB == ContentFillBox)
326 return ContentFillBox;
327 return TextFillBox;
328 }
329
330 void FillLayer::computeCachedPropertiesIfNeeded() const 319 void FillLayer::computeCachedPropertiesIfNeeded() const
331 { 320 {
332 if (m_cachedPropertiesComputed) 321 if (m_cachedPropertiesComputed)
333 return; 322 return;
334 m_thisOrNextLayersClipMax = clip(); 323 m_thisOrNextLayersClipMax = clip();
335 m_thisOrNextLayersUseContentBox = clip() == ContentFillBox || origin() == Co ntentFillBox; 324 m_thisOrNextLayersUseContentBox = clip() == ContentFillBox || origin() == Co ntentFillBox;
336 m_thisOrNextLayersHaveLocalAttachment = attachment() == LocalBackgroundAttac hment; 325 m_thisOrNextLayersHaveLocalAttachment = attachment() == LocalBackgroundAttac hment;
337 m_cachedPropertiesComputed = true; 326 m_cachedPropertiesComputed = true;
338 327
339 if (m_next) { 328 if (m_next) {
340 m_next->computeCachedPropertiesIfNeeded(); 329 m_next->computeCachedPropertiesIfNeeded();
341 m_thisOrNextLayersClipMax = clipMax(thisOrNextLayersClipMax(), m_next->t hisOrNextLayersClipMax()); 330 m_thisOrNextLayersClipMax = enclosingFillBox(thisOrNextLayersClipMax(), m_next->thisOrNextLayersClipMax());
342 m_thisOrNextLayersUseContentBox |= m_next->m_thisOrNextLayersUseContentB ox; 331 m_thisOrNextLayersUseContentBox |= m_next->m_thisOrNextLayersUseContentB ox;
343 m_thisOrNextLayersHaveLocalAttachment |= m_next->m_thisOrNextLayersHaveL ocalAttachment; 332 m_thisOrNextLayersHaveLocalAttachment |= m_next->m_thisOrNextLayersHaveL ocalAttachment;
344 } 333 }
345 } 334 }
346 335
347 bool FillLayer::clipOccludesNextLayers() const 336 bool FillLayer::clipOccludesNextLayers() const
348 { 337 {
349 return clip() == thisOrNextLayersClipMax(); 338 return clip() == thisOrNextLayersClipMax();
350 } 339 }
351 340
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 { 408 {
420 for (; layer1 && layer2; layer1 = layer1->next(), layer2 = layer2->next()) { 409 for (; layer1 && layer2; layer1 = layer1->next(), layer2 = layer2->next()) {
421 if (!layerImagesIdentical(*layer1, *layer2)) 410 if (!layerImagesIdentical(*layer1, *layer2))
422 return false; 411 return false;
423 } 412 }
424 413
425 return !layer1 && !layer2; 414 return !layer1 && !layer2;
426 } 415 }
427 416
428 } // namespace blink 417 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698