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

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

Issue 2890733002: Make EBorderStyle an enum class. (Closed)
Patch Set: Build for Mac Created 3 years, 7 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/ImageQualityController.h" 10 #include "core/layout/ImageQualityController.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // TODO(fmalita): we should be able to fold these parameters into 309 // TODO(fmalita): we should be able to fold these parameters into
310 // BoxBorderInfo or BoxDecorationData and avoid calling getBorderEdgeInfo 310 // BoxBorderInfo or BoxDecorationData and avoid calling getBorderEdgeInfo
311 // redundantly here. 311 // redundantly here.
312 BorderEdge edges[4]; 312 BorderEdge edges[4];
313 style.GetBorderEdgeInfo(edges, include_logical_left_edge, 313 style.GetBorderEdgeInfo(edges, include_logical_left_edge,
314 include_logical_right_edge); 314 include_logical_right_edge);
315 315
316 // Use the most conservative inset to avoid mixed-style corner issues. 316 // Use the most conservative inset to avoid mixed-style corner issues.
317 float fractional_inset = 1.0f / 2; 317 float fractional_inset = 1.0f / 2;
318 for (auto& edge : edges) { 318 for (auto& edge : edges) {
319 if (edge.BorderStyle() == kBorderStyleDouble) { 319 if (edge.BorderStyle() == EBorderStyle::kDouble) {
320 fractional_inset = 1.0f / 6; 320 fractional_inset = 1.0f / 6;
321 break; 321 break;
322 } 322 }
323 } 323 }
324 324
325 FloatRectOutsets insets(-fractional_inset * edges[kBSTop].Width(), 325 FloatRectOutsets insets(-fractional_inset * edges[kBSTop].Width(),
326 -fractional_inset * edges[kBSRight].Width(), 326 -fractional_inset * edges[kBSRight].Width(),
327 -fractional_inset * edges[kBSBottom].Width(), 327 -fractional_inset * edges[kBSBottom].Width(),
328 -fractional_inset * edges[kBSLeft].Width()); 328 -fractional_inset * edges[kBSLeft].Width());
329 329
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 if (PaintNinePieceImage(obj, info.context, rect, style, style.BorderImage())) 871 if (PaintNinePieceImage(obj, info.context, rect, style, style.BorderImage()))
872 return; 872 return;
873 873
874 const BoxBorderPainter border_painter(rect, style, bleed_avoidance, 874 const BoxBorderPainter border_painter(rect, style, bleed_avoidance,
875 include_logical_left_edge, 875 include_logical_left_edge,
876 include_logical_right_edge); 876 include_logical_right_edge);
877 border_painter.PaintBorder(info, rect); 877 border_painter.PaintBorder(info, rect);
878 } 878 }
879 879
880 } // namespace blink 880 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ObjectPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698