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

Side by Side Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/BoxPainter.h" 5 #include "core/paint/BoxPainter.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "core/layout/BackgroundBleedAvoidance.h" 10 #include "core/layout/BackgroundBleedAvoidance.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 const LayoutSize& container_size) 260 const LayoutSize& container_size)
261 : context_(context), 261 : context_(context),
262 previous_interpolation_quality_(context.ImageInterpolationQuality()) { 262 previous_interpolation_quality_(context.ImageInterpolationQuality()) {
263 SkBlendMode bg_op = 263 SkBlendMode bg_op =
264 WebCoreCompositeToSkiaComposite(layer.Composite(), layer.BlendMode()); 264 WebCoreCompositeToSkiaComposite(layer.Composite(), layer.BlendMode());
265 // if op != SkBlendMode::kSrcOver, a mask is being painted. 265 // if op != SkBlendMode::kSrcOver, a mask is being painted.
266 composite_op_ = (op == SkBlendMode::kSrcOver) ? bg_op : op; 266 composite_op_ = (op == SkBlendMode::kSrcOver) ? bg_op : op;
267 267
268 const LayoutObject& image_client = 268 const LayoutObject& image_client =
269 background_object ? *background_object : obj; 269 background_object ? *background_object : obj;
270 image_ = style_image.GetImage(image_client, FlooredIntSize(container_size)); 270 image_ = style_image.GetImage(image_client, image_client.GetDocument(),
271 image_client.StyleRef(),
272 FlooredIntSize(container_size));
271 273
272 interpolation_quality_ = BoxPainter::ChooseInterpolationQuality( 274 interpolation_quality_ = BoxPainter::ChooseInterpolationQuality(
273 image_client, image_.Get(), &layer, container_size); 275 image_client, image_.Get(), &layer, container_size);
274 if (interpolation_quality_ != previous_interpolation_quality_) 276 if (interpolation_quality_ != previous_interpolation_quality_)
275 context.SetImageInterpolationQuality(interpolation_quality_); 277 context.SetImageInterpolationQuality(interpolation_quality_);
276 278
277 if (layer.MaskSourceType() == kMaskLuminance) 279 if (layer.MaskSourceType() == kMaskLuminance)
278 context.SetColorFilter(kColorFilterLuminanceToAlpha); 280 context.SetColorFilter(kColorFilterLuminanceToAlpha);
279 } 281 }
280 282
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 if (PaintNinePieceImage(obj, info.context, rect, style, style.BorderImage())) 710 if (PaintNinePieceImage(obj, info.context, rect, style, style.BorderImage()))
709 return; 711 return;
710 712
711 const BoxBorderPainter border_painter(rect, style, bleed_avoidance, 713 const BoxBorderPainter border_painter(rect, style, bleed_avoidance,
712 include_logical_left_edge, 714 include_logical_left_edge,
713 include_logical_right_edge); 715 include_logical_right_edge);
714 border_painter.PaintBorder(info, rect); 716 border_painter.PaintBorder(info, rect);
715 } 717 }
716 718
717 } // namespace blink 719 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698