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

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

Issue 2225033003: Separate backgroundObscurationStatus and hasBoxDecorationBackground (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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) 2007 Apple Inc. 2 * Copyright (C) 2007 Apple Inc.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2008 Collabora Ltd. 4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008, 2009 Google Inc. 5 * Copyright (C) 2008, 2009 Google Inc.
6 * Copyright (C) 2009 Kenneth Rohde Christiansen 6 * Copyright (C) 2009 Kenneth Rohde Christiansen
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartRadio, getWebThemeState(o), WebRect(rect), &extraParams); 170 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartRadio, getWebThemeState(o), WebRect(rect), &extraParams);
171 return false; 171 return false;
172 } 172 }
173 173
174 bool ThemePainterDefault::paintButton(const LayoutObject& o, const PaintInfo& i, const IntRect& rect) 174 bool ThemePainterDefault::paintButton(const LayoutObject& o, const PaintInfo& i, const IntRect& rect)
175 { 175 {
176 WebThemeEngine::ExtraParams extraParams; 176 WebThemeEngine::ExtraParams extraParams;
177 WebCanvas* canvas = i.context.canvas(); 177 WebCanvas* canvas = i.context.canvas();
178 extraParams.button.hasBorder = true; 178 extraParams.button.hasBorder = true;
179 extraParams.button.backgroundColor = useMockTheme() ? 0xffc0c0c0 : defaultBu ttonBackgroundColor; 179 extraParams.button.backgroundColor = useMockTheme() ? 0xffc0c0c0 : defaultBu ttonBackgroundColor;
180 if (o.hasBackground()) 180 if (o.styleRef().hasBackground())
181 extraParams.button.backgroundColor = o.resolveColor(CSSPropertyBackgroun dColor).rgb(); 181 extraParams.button.backgroundColor = o.resolveColor(CSSPropertyBackgroun dColor).rgb();
182 182
183 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartButton , getWebThemeState(o), WebRect(rect), &extraParams); 183 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartButton , getWebThemeState(o), WebRect(rect), &extraParams);
184 return false; 184 return false;
185 } 185 }
186 186
187 bool ThemePainterDefault::paintTextField(const LayoutObject& o, const PaintInfo& i, const IntRect& rect) 187 bool ThemePainterDefault::paintTextField(const LayoutObject& o, const PaintInfo& i, const IntRect& rect)
188 { 188 {
189 // WebThemeEngine does not handle border rounded corner and background image 189 // WebThemeEngine does not handle border rounded corner and background image
190 // so return true to draw CSS border and background. 190 // so return true to draw CSS border and background.
(...skipping 20 matching lines...) Expand all
211 if (!o.isBox()) 211 if (!o.isBox())
212 return false; 212 return false;
213 213
214 WebThemeEngine::ExtraParams extraParams; 214 WebThemeEngine::ExtraParams extraParams;
215 const LayoutBox& box = toLayoutBox(o); 215 const LayoutBox& box = toLayoutBox(o);
216 // Match Chromium Win behaviour of showing all borders if any are shown. 216 // Match Chromium Win behaviour of showing all borders if any are shown.
217 extraParams.menuList.hasBorder = box.borderRight() || box.borderLeft() || bo x.borderTop() || box.borderBottom(); 217 extraParams.menuList.hasBorder = box.borderRight() || box.borderLeft() || bo x.borderTop() || box.borderBottom();
218 extraParams.menuList.hasBorderRadius = o.styleRef().hasBorderRadius(); 218 extraParams.menuList.hasBorderRadius = o.styleRef().hasBorderRadius();
219 // Fallback to transparent if the specified color object is invalid. 219 // Fallback to transparent if the specified color object is invalid.
220 Color backgroundColor(Color::transparent); 220 Color backgroundColor(Color::transparent);
221 if (o.hasBackground()) 221 if (o.styleRef().hasBackground())
222 backgroundColor = o.resolveColor(CSSPropertyBackgroundColor); 222 backgroundColor = o.resolveColor(CSSPropertyBackgroundColor);
223 extraParams.menuList.backgroundColor = backgroundColor.rgb(); 223 extraParams.menuList.backgroundColor = backgroundColor.rgb();
224 224
225 // If we have a background image, don't fill the content area to expose the 225 // If we have a background image, don't fill the content area to expose the
226 // parent's background. Also, we shouldn't fill the content area if the 226 // parent's background. Also, we shouldn't fill the content area if the
227 // alpha of the color is 0. The API of Windows GDI ignores the alpha. 227 // alpha of the color is 0. The API of Windows GDI ignores the alpha.
228 // FIXME: the normal Aura theme doesn't care about this, so we should 228 // FIXME: the normal Aura theme doesn't care about this, so we should
229 // investigate if we really need fillContentArea. 229 // investigate if we really need fillContentArea.
230 extraParams.menuList.fillContentArea = !o.styleRef().hasBackgroundImage() && backgroundColor.alpha(); 230 extraParams.menuList.fillContentArea = !o.styleRef().hasBackgroundImage() && backgroundColor.alpha();
231 231
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 cancelButtonSize, cancelButtonSize); 392 cancelButtonSize, cancelButtonSize);
393 IntRect paintingRect = convertToPaintingRect(inputLayoutBox, cancelButtonObj ect, cancelButtonRect, r); 393 IntRect paintingRect = convertToPaintingRect(inputLayoutBox, cancelButtonObj ect, cancelButtonRect, r);
394 394
395 DEFINE_STATIC_REF(Image, cancelImage, (Image::loadPlatformResource("searchCa ncel"))); 395 DEFINE_STATIC_REF(Image, cancelImage, (Image::loadPlatformResource("searchCa ncel")));
396 DEFINE_STATIC_REF(Image, cancelPressedImage, (Image::loadPlatformResource("s earchCancelPressed"))); 396 DEFINE_STATIC_REF(Image, cancelPressedImage, (Image::loadPlatformResource("s earchCancelPressed")));
397 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) ? can celPressedImage : cancelImage, paintingRect); 397 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) ? can celPressedImage : cancelImage, paintingRect);
398 return false; 398 return false;
399 } 399 }
400 400
401 } // namespace blink 401 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableSectionPainter.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698