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

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 23947005: Implement CSS luminance masking using skia SkLumaMaskXfermode class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 // no progressive loading of the background image 735 // no progressive loading of the background image
736 if (shouldPaintBackgroundImage) { 736 if (shouldPaintBackgroundImage) {
737 BackgroundImageGeometry geometry; 737 BackgroundImageGeometry geometry;
738 calculateBackgroundImageGeometry(bgLayer, scrolledPaintRect, geometry, b ackgroundObject); 738 calculateBackgroundImageGeometry(bgLayer, scrolledPaintRect, geometry, b ackgroundObject);
739 geometry.clip(paintInfo.rect); 739 geometry.clip(paintInfo.rect);
740 if (!geometry.destRect().isEmpty()) { 740 if (!geometry.destRect().isEmpty()) {
741 CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer- >composite() : op; 741 CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer- >composite() : op;
742 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou ndObject : this; 742 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou ndObject : this;
743 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome try.tileSize()); 743 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome try.tileSize());
744 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.g et(), bgLayer, geometry.tileSize()); 744 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.g et(), bgLayer, geometry.tileSize());
745 context->setDrawLuminanceMask(bgLayer->maskSourceType() == EMaskSour ceType::MaskLuminance);
745 context->drawTiledImage(image.get(), geometry.destRect(), geometry.r elativePhase(), geometry.tileSize(), 746 context->drawTiledImage(image.get(), geometry.destRect(), geometry.r elativePhase(), geometry.tileSize(),
746 compositeOp, useLowQualityScaling, bgLayer->blendMode()); 747 compositeOp, useLowQualityScaling, bgLayer->blendMode());
747 } 748 }
748 } 749 }
749 750
750 if (bgLayer->clip() == TextFillBox) { 751 if (bgLayer->clip() == TextFillBox) {
751 // Create the text mask layer. 752 // Create the text mask layer.
752 context->setCompositeOperation(CompositeDestinationIn); 753 context->setCompositeOperation(CompositeDestinationIn);
753 context->beginTransparencyLayer(1); 754 context->beginTransparencyLayer(1);
754 755
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after
2786 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2787 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2787 for (RenderObject* child = startChild; child && child != endChild; ) { 2788 for (RenderObject* child = startChild; child && child != endChild; ) {
2788 // Save our next sibling as moveChildTo will clear it. 2789 // Save our next sibling as moveChildTo will clear it.
2789 RenderObject* nextSibling = child->nextSibling(); 2790 RenderObject* nextSibling = child->nextSibling();
2790 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2791 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2791 child = nextSibling; 2792 child = nextSibling;
2792 } 2793 }
2793 } 2794 }
2794 2795
2795 } // namespace WebCore 2796 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698