OLD | NEW |
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/ImagePainter.h" | 5 #include "core/paint/ImagePainter.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 if (paint_info.phase == kPaintPhaseOutline) | 29 if (paint_info.phase == kPaintPhaseOutline) |
30 PaintAreaElementFocusRing(paint_info, paint_offset); | 30 PaintAreaElementFocusRing(paint_info, paint_offset); |
31 } | 31 } |
32 | 32 |
33 void ImagePainter::PaintAreaElementFocusRing(const PaintInfo& paint_info, | 33 void ImagePainter::PaintAreaElementFocusRing(const PaintInfo& paint_info, |
34 const LayoutPoint& paint_offset) { | 34 const LayoutPoint& paint_offset) { |
35 Document& document = layout_image_.GetDocument(); | 35 Document& document = layout_image_.GetDocument(); |
36 | 36 |
37 if (paint_info.IsPrinting() || | 37 if (paint_info.IsPrinting() || |
38 !document.GetFrame()->Selection().IsFocusedAndActive()) | 38 !document.GetFrame()->Selection().FrameIsFocusedAndActive()) |
39 return; | 39 return; |
40 | 40 |
41 Element* focused_element = document.FocusedElement(); | 41 Element* focused_element = document.FocusedElement(); |
42 if (!isHTMLAreaElement(focused_element)) | 42 if (!isHTMLAreaElement(focused_element)) |
43 return; | 43 return; |
44 | 44 |
45 HTMLAreaElement& area_element = toHTMLAreaElement(*focused_element); | 45 HTMLAreaElement& area_element = toHTMLAreaElement(*focused_element); |
46 if (area_element.ImageElement() != layout_image_.GetNode()) | 46 if (area_element.ImageElement() != layout_image_.GetNode()) |
47 return; | 47 return; |
48 | 48 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 InterpolationQuality previous_interpolation_quality = | 174 InterpolationQuality previous_interpolation_quality = |
175 context.ImageInterpolationQuality(); | 175 context.ImageInterpolationQuality(); |
176 context.SetImageInterpolationQuality(interpolation_quality); | 176 context.SetImageInterpolationQuality(interpolation_quality); |
177 context.DrawImage( | 177 context.DrawImage( |
178 image.Get(), pixel_snapped_dest_rect, &src_rect, SkBlendMode::kSrcOver, | 178 image.Get(), pixel_snapped_dest_rect, &src_rect, SkBlendMode::kSrcOver, |
179 LayoutObject::ShouldRespectImageOrientation(&layout_image_)); | 179 LayoutObject::ShouldRespectImageOrientation(&layout_image_)); |
180 context.SetImageInterpolationQuality(previous_interpolation_quality); | 180 context.SetImageInterpolationQuality(previous_interpolation_quality); |
181 } | 181 } |
182 | 182 |
183 } // namespace blink | 183 } // namespace blink |
OLD | NEW |