OLD | NEW |
1 /** | 1 /** |
2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
3 * | 3 * |
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. | 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "core/html/HTMLOptionElement.h" | 30 #include "core/html/HTMLOptionElement.h" |
31 #include "core/html/parser/HTMLParserIdioms.h" | 31 #include "core/html/parser/HTMLParserIdioms.h" |
32 #include "core/html/shadow/ShadowElementNames.h" | 32 #include "core/html/shadow/ShadowElementNames.h" |
33 #include "core/layout/LayoutTheme.h" | 33 #include "core/layout/LayoutTheme.h" |
34 #include "core/layout/LayoutView.h" | 34 #include "core/layout/LayoutView.h" |
35 #include "core/paint/MediaControlsPainter.h" | 35 #include "core/paint/MediaControlsPainter.h" |
36 #include "core/paint/PaintInfo.h" | 36 #include "core/paint/PaintInfo.h" |
37 #include "core/style/ComputedStyle.h" | 37 #include "core/style/ComputedStyle.h" |
38 #include "platform/Theme.h" | 38 #include "platform/Theme.h" |
39 #include "platform/graphics/GraphicsContextStateSaver.h" | 39 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 40 #include "platform/graphics/paint/PaintCanvas.h" |
40 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
41 #include "public/platform/WebFallbackThemeEngine.h" | 42 #include "public/platform/WebFallbackThemeEngine.h" |
42 #include "public/platform/WebRect.h" | 43 #include "public/platform/WebRect.h" |
43 | 44 |
44 // The methods in this file are shared by all themes on every platform. | 45 // The methods in this file are shared by all themes on every platform. |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 static WebFallbackThemeEngine::State getWebFallbackThemeState( | 49 static WebFallbackThemeEngine::State getWebFallbackThemeState( |
49 const LayoutObject& o) { | 50 const LayoutObject& o) { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 default: | 357 default: |
357 break; | 358 break; |
358 } | 359 } |
359 return true; | 360 return true; |
360 } | 361 } |
361 | 362 |
362 bool ThemePainter::paintCheckboxUsingFallbackTheme(const LayoutObject& o, | 363 bool ThemePainter::paintCheckboxUsingFallbackTheme(const LayoutObject& o, |
363 const PaintInfo& i, | 364 const PaintInfo& i, |
364 const IntRect& r) { | 365 const IntRect& r) { |
365 WebFallbackThemeEngine::ExtraParams extraParams; | 366 WebFallbackThemeEngine::ExtraParams extraParams; |
366 WebCanvas* canvas = i.context.canvas(); | 367 PaintCanvas* canvas = i.context.canvas(); |
367 extraParams.button.checked = LayoutTheme::isChecked(o); | 368 extraParams.button.checked = LayoutTheme::isChecked(o); |
368 extraParams.button.indeterminate = LayoutTheme::isIndeterminate(o); | 369 extraParams.button.indeterminate = LayoutTheme::isIndeterminate(o); |
369 | 370 |
370 float zoomLevel = o.styleRef().effectiveZoom(); | 371 float zoomLevel = o.styleRef().effectiveZoom(); |
371 GraphicsContextStateSaver stateSaver(i.context); | 372 GraphicsContextStateSaver stateSaver(i.context); |
372 IntRect unzoomedRect = r; | 373 IntRect unzoomedRect = r; |
373 if (zoomLevel != 1) { | 374 if (zoomLevel != 1) { |
374 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); | 375 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); |
375 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); | 376 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); |
376 i.context.translate(unzoomedRect.x(), unzoomedRect.y()); | 377 i.context.translate(unzoomedRect.x(), unzoomedRect.y()); |
(...skipping 26 matching lines...) Expand all Loading... |
403 i.context.translate(-unzoomedRect.x(), -unzoomedRect.y()); | 404 i.context.translate(-unzoomedRect.x(), -unzoomedRect.y()); |
404 } | 405 } |
405 | 406 |
406 Platform::current()->fallbackThemeEngine()->paint( | 407 Platform::current()->fallbackThemeEngine()->paint( |
407 canvas, WebFallbackThemeEngine::PartRadio, getWebFallbackThemeState(o), | 408 canvas, WebFallbackThemeEngine::PartRadio, getWebFallbackThemeState(o), |
408 WebRect(unzoomedRect), &extraParams); | 409 WebRect(unzoomedRect), &extraParams); |
409 return false; | 410 return false; |
410 } | 411 } |
411 | 412 |
412 } // namespace blink | 413 } // namespace blink |
OLD | NEW |