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

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

Issue 1885713002: Remove the user counter for border-image elements with no border style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/Deprecation.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/NinePieceImagePainter.h" 5 #include "core/paint/NinePieceImagePainter.h"
6 6
7 #include "core/frame/Deprecation.h"
8 #include "core/layout/ImageQualityController.h" 7 #include "core/layout/ImageQualityController.h"
9 #include "core/layout/LayoutBoxModelObject.h" 8 #include "core/layout/LayoutBoxModelObject.h"
10 #include "core/paint/BoxPainter.h" 9 #include "core/paint/BoxPainter.h"
11 #include "core/paint/NinePieceImageGrid.h" 10 #include "core/paint/NinePieceImageGrid.h"
12 #include "core/style/ComputedStyle.h" 11 #include "core/style/ComputedStyle.h"
13 #include "core/style/NinePieceImage.h" 12 #include "core/style/NinePieceImage.h"
14 #include "platform/geometry/IntSize.h" 13 #include "platform/geometry/IntSize.h"
15 #include "platform/geometry/LayoutRect.h" 14 #include "platform/geometry/LayoutRect.h"
16 #include "platform/graphics/GraphicsContext.h" 15 #include "platform/graphics/GraphicsContext.h"
17 16
(...skipping 10 matching lines...) Expand all
28 StyleImage* styleImage = ninePieceImage.image(); 27 StyleImage* styleImage = ninePieceImage.image();
29 if (!styleImage) 28 if (!styleImage)
30 return false; 29 return false;
31 30
32 if (!styleImage->isLoaded()) 31 if (!styleImage->isLoaded())
33 return true; // Never paint a nine-piece image incrementally, but don't paint the fallback borders either. 32 return true; // Never paint a nine-piece image incrementally, but don't paint the fallback borders either.
34 33
35 if (!styleImage->canRender()) 34 if (!styleImage->canRender())
36 return false; 35 return false;
37 36
38 // Find out if the hasImage() check in ComputedStyle::border*Width had any a ffect, i.e. if a border is non-zero while border-style is
39 // none or hidden.
40 if ((style.borderLeftWidth() && (style.borderLeft().style() == BorderStyleNo ne || style.borderLeft().style() == BorderStyleHidden))
41 || (style.borderRightWidth() && (style.borderRight().style() == BorderSt yleNone || style.borderRight().style() == BorderStyleHidden))
42 || (style.borderTopWidth() && (style.borderTop().style() == BorderStyleN one || style.borderTop().style() == BorderStyleHidden))
43 || (style.borderBottomWidth() && (style.borderBottom().style() == Border StyleNone || style.borderBottom().style() == BorderStyleHidden)))
44 Deprecation::countDeprecation(m_layoutObject.document(), UseCounter::Bor derImageWithBorderStyleNone);
45
46 // FIXME: border-image is broken with full page zooming when tiling has to h appen, since the tiling function 37 // FIXME: border-image is broken with full page zooming when tiling has to h appen, since the tiling function
47 // doesn't have any understanding of the zoom that is in effect on the tile. 38 // doesn't have any understanding of the zoom that is in effect on the tile.
48 LayoutRect rectWithOutsets = rect; 39 LayoutRect rectWithOutsets = rect;
49 rectWithOutsets.expand(style.imageOutsets(ninePieceImage)); 40 rectWithOutsets.expand(style.imageOutsets(ninePieceImage));
50 LayoutRect borderImageRect = rectWithOutsets; 41 LayoutRect borderImageRect = rectWithOutsets;
51 42
52 // NinePieceImage returns the image slices without effective zoom applied an d thus we compute 43 // NinePieceImage returns the image slices without effective zoom applied an d thus we compute
53 // the nine piece grid on top of the image in unzoomed coordinates. 44 // the nine piece grid on top of the image in unzoomed coordinates.
54 LayoutSize defaultObjectSize = borderImageRect.size(); 45 LayoutSize defaultObjectSize = borderImageRect.size();
55 defaultObjectSize.scale(1 / style.effectiveZoom()); 46 defaultObjectSize.scale(1 / style.effectiveZoom());
(...skipping 28 matching lines...) Expand all
84 drawInfo.tileRule.vertical, op); 75 drawInfo.tileRule.vertical, op);
85 } 76 }
86 } 77 }
87 } 78 }
88 79
89 graphicsContext.setImageInterpolationQuality(previousInterpolationQuality); 80 graphicsContext.setImageInterpolationQuality(previousInterpolationQuality);
90 return true; 81 return true;
91 } 82 }
92 83
93 } // namespace blink 84 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Deprecation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698