OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool ScrollbarThemeMock::usesOverlayScrollbars() const | 50 bool ScrollbarThemeMock::usesOverlayScrollbars() const |
51 { | 51 { |
52 return RuntimeEnabledFeatures::overlayScrollbarsEnabled(); | 52 return RuntimeEnabledFeatures::overlayScrollbarsEnabled(); |
53 } | 53 } |
54 | 54 |
55 bool ScrollbarThemeMock::shouldRepaintAllPartsOnInvalidation() const | 55 bool ScrollbarThemeMock::shouldRepaintAllPartsOnInvalidation() const |
56 { | 56 { |
57 return gShouldRepaintAllPartsOnInvalidation; | 57 return gShouldRepaintAllPartsOnInvalidation; |
58 } | 58 } |
59 | 59 |
60 IntRect ScrollbarThemeMock::trackRect(const ScrollbarThemeClient* scrollbar, boo
l) | 60 IntRect ScrollbarThemeMock::trackRect(const ScrollbarThemeClient& scrollbar, boo
l) |
61 { | 61 { |
62 return scrollbar->frameRect(); | 62 return scrollbar.frameRect(); |
63 } | 63 } |
64 | 64 |
65 | 65 void ScrollbarThemeMock::paintTrackBackground(GraphicsContext& context, const Sc
rollbarThemeClient& scrollbar, const IntRect& trackRect) |
66 void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, const Sc
rollbarThemeClient* scrollbar, const IntRect& trackRect) | |
67 { | 66 { |
68 if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, Displa
yItem::ScrollbarTrackBackground)) | 67 if (DrawingRecorder::useCachedDrawingIfPossible(context, scrollbar, DisplayI
tem::ScrollbarTrackBackground)) |
69 return; | 68 return; |
70 | 69 |
71 DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarTrackBa
ckground, trackRect); | 70 DrawingRecorder recorder(context, scrollbar, DisplayItem::ScrollbarTrackBack
ground, trackRect); |
72 context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color
(0xFFE0E0E0)); | 71 context.fillRect(trackRect, scrollbar.enabled() ? Color::lightGray : Color(0
xFFE0E0E0)); |
73 } | 72 } |
74 | 73 |
75 void ScrollbarThemeMock::paintThumb(GraphicsContext* context, const ScrollbarThe
meClient* scrollbar, const IntRect& thumbRect) | 74 void ScrollbarThemeMock::paintThumb(GraphicsContext& context, const ScrollbarThe
meClient& scrollbar, const IntRect& thumbRect) |
76 { | 75 { |
77 if (!scrollbar->enabled()) | 76 if (!scrollbar.enabled()) |
78 return; | 77 return; |
79 | 78 |
80 if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, Displa
yItem::ScrollbarThumb)) | 79 if (DrawingRecorder::useCachedDrawingIfPossible(context, scrollbar, DisplayI
tem::ScrollbarThumb)) |
81 return; | 80 return; |
82 | 81 |
83 DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarThumb,
thumbRect); | 82 DrawingRecorder recorder(context, scrollbar, DisplayItem::ScrollbarThumb, th
umbRect); |
84 context->fillRect(thumbRect, Color::darkGray); | 83 context.fillRect(thumbRect, Color::darkGray); |
85 } | 84 } |
86 | 85 |
87 } | 86 } |
88 | 87 |
OLD | NEW |