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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "platform/PlatformMouseEvent.h" | 28 #include "platform/PlatformMouseEvent.h" |
29 #include "platform/RuntimeEnabledFeatures.h" | 29 #include "platform/RuntimeEnabledFeatures.h" |
30 #include "platform/graphics/Color.h" | 30 #include "platform/graphics/Color.h" |
31 #include "platform/graphics/GraphicsContext.h" | 31 #include "platform/graphics/GraphicsContext.h" |
32 #include "platform/graphics/paint/CompositingRecorder.h" | 32 #include "platform/graphics/paint/CompositingRecorder.h" |
33 #include "platform/graphics/paint/CullRect.h" | 33 #include "platform/graphics/paint/CullRect.h" |
34 #include "platform/graphics/paint/DrawingDisplayItem.h" | 34 #include "platform/graphics/paint/DrawingDisplayItem.h" |
35 #include "platform/graphics/paint/DrawingRecorder.h" | 35 #include "platform/graphics/paint/DrawingRecorder.h" |
36 #include "platform/graphics/paint/PaintController.h" | 36 #include "platform/graphics/paint/PaintController.h" |
37 #include "platform/scroll/ScrollbarThemeClient.h" | 37 #include "platform/scroll/Scrollbar.h" |
38 #include "platform/scroll/ScrollbarThemeMock.h" | 38 #include "platform/scroll/ScrollbarThemeMock.h" |
39 #include "platform/scroll/ScrollbarThemeOverlayMock.h" | 39 #include "platform/scroll/ScrollbarThemeOverlayMock.h" |
40 #include "public/platform/Platform.h" | 40 #include "public/platform/Platform.h" |
41 #include "public/platform/WebPoint.h" | 41 #include "public/platform/WebPoint.h" |
42 #include "public/platform/WebRect.h" | 42 #include "public/platform/WebRect.h" |
43 #include "public/platform/WebScrollbarBehavior.h" | 43 #include "public/platform/WebScrollbarBehavior.h" |
44 #include "wtf/Optional.h" | 44 #include "wtf/Optional.h" |
45 | 45 |
46 #if !OS(MACOSX) | 46 #if !OS(MACOSX) |
47 #include "public/platform/WebThemeEngine.h" | 47 #include "public/platform/WebThemeEngine.h" |
48 #endif | 48 #endif |
49 | 49 |
50 namespace blink { | 50 namespace blink { |
51 | 51 |
52 bool ScrollbarTheme::gMockScrollbarsEnabled = false; | 52 bool ScrollbarTheme::gMockScrollbarsEnabled = false; |
53 | 53 |
54 static inline bool shouldPaintScrollbarPart(const IntRect& partRect, const CullR
ect& cullRect) | 54 static inline bool shouldPaintScrollbarPart(const IntRect& partRect, const CullR
ect& cullRect) |
55 { | 55 { |
56 return (!partRect.isEmpty()) || cullRect.intersectsCullRect(partRect); | 56 return (!partRect.isEmpty()) || cullRect.intersectsCullRect(partRect); |
57 } | 57 } |
58 | 58 |
59 bool ScrollbarTheme::paint(const ScrollbarThemeClient& scrollbar, GraphicsContex
t& graphicsContext, const CullRect& cullRect) | 59 bool ScrollbarTheme::paint(const Scrollbar& scrollbar, GraphicsContext& graphics
Context, const CullRect& cullRect) |
60 { | 60 { |
61 // Create the ScrollbarControlPartMask based on the cullRect | 61 // Create the ScrollbarControlPartMask based on the cullRect |
62 ScrollbarControlPartMask scrollMask = NoPart; | 62 ScrollbarControlPartMask scrollMask = NoPart; |
63 | 63 |
64 IntRect backButtonStartPaintRect; | 64 IntRect backButtonStartPaintRect; |
65 IntRect backButtonEndPaintRect; | 65 IntRect backButtonEndPaintRect; |
66 IntRect forwardButtonStartPaintRect; | 66 IntRect forwardButtonStartPaintRect; |
67 IntRect forwardButtonEndPaintRect; | 67 IntRect forwardButtonEndPaintRect; |
68 if (hasButtons(scrollbar)) { | 68 if (hasButtons(scrollbar)) { |
69 backButtonStartPaintRect = backButtonRect(scrollbar, BackButtonStartPart
, true); | 69 backButtonStartPaintRect = backButtonRect(scrollbar, BackButtonStartPart
, true); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 return DisplayItem::ScrollbarBackTrack; | 341 return DisplayItem::ScrollbarBackTrack; |
342 case ForwardTrackPart: | 342 case ForwardTrackPart: |
343 return DisplayItem::ScrollbarForwardTrack; | 343 return DisplayItem::ScrollbarForwardTrack; |
344 default: | 344 default: |
345 ASSERT_NOT_REACHED(); | 345 ASSERT_NOT_REACHED(); |
346 return DisplayItem::ScrollbarBackTrack; | 346 return DisplayItem::ScrollbarBackTrack; |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
350 } // namespace blink | 350 } // namespace blink |
OLD | NEW |