OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 ScrollbarPart part) { | 312 ScrollbarPart part) { |
313 DisplayItem::Type displayItemType = buttonPartToDisplayItemType(part); | 313 DisplayItem::Type displayItemType = buttonPartToDisplayItemType(part); |
314 if (DrawingRecorder::useCachedDrawingIfPossible(gc, scrollbar, | 314 if (DrawingRecorder::useCachedDrawingIfPossible(gc, scrollbar, |
315 displayItemType)) | 315 displayItemType)) |
316 return; | 316 return; |
317 PartPaintingParams params = | 317 PartPaintingParams params = |
318 buttonPartPaintingParams(scrollbar, scrollbar.currentPos(), part); | 318 buttonPartPaintingParams(scrollbar, scrollbar.currentPos(), part); |
319 if (!params.shouldPaint) | 319 if (!params.shouldPaint) |
320 return; | 320 return; |
321 DrawingRecorder recorder(gc, scrollbar, displayItemType, rect); | 321 DrawingRecorder recorder(gc, scrollbar, displayItemType, rect); |
322 Platform::current()->themeEngine()->paint(gc.canvas(), params.part, | 322 Platform::current()->themeEngine()->paint( |
323 params.state, WebRect(rect), 0); | 323 gc.canvas(), params.part, params.state, WebRect(rect), nullptr); |
324 } | 324 } |
325 | 325 |
326 void ScrollbarThemeAura::paintThumb(GraphicsContext& gc, | 326 void ScrollbarThemeAura::paintThumb(GraphicsContext& gc, |
327 const Scrollbar& scrollbar, | 327 const Scrollbar& scrollbar, |
328 const IntRect& rect) { | 328 const IntRect& rect) { |
329 if (DrawingRecorder::useCachedDrawingIfPossible(gc, scrollbar, | 329 if (DrawingRecorder::useCachedDrawingIfPossible(gc, scrollbar, |
330 DisplayItem::kScrollbarThumb)) | 330 DisplayItem::kScrollbarThumb)) |
331 return; | 331 return; |
332 | 332 |
333 DrawingRecorder recorder(gc, scrollbar, DisplayItem::kScrollbarThumb, rect); | 333 DrawingRecorder recorder(gc, scrollbar, DisplayItem::kScrollbarThumb, rect); |
334 | 334 |
335 WebThemeEngine::State state; | 335 WebThemeEngine::State state; |
336 WebCanvas* canvas = gc.canvas(); | 336 WebCanvas* canvas = gc.canvas(); |
337 if (scrollbar.pressedPart() == ThumbPart) | 337 if (scrollbar.pressedPart() == ThumbPart) |
338 state = WebThemeEngine::StatePressed; | 338 state = WebThemeEngine::StatePressed; |
339 else if (scrollbar.hoveredPart() == ThumbPart) | 339 else if (scrollbar.hoveredPart() == ThumbPart) |
340 state = WebThemeEngine::StateHover; | 340 state = WebThemeEngine::StateHover; |
341 else | 341 else |
342 state = WebThemeEngine::StateNormal; | 342 state = WebThemeEngine::StateNormal; |
| 343 |
343 Platform::current()->themeEngine()->paint( | 344 Platform::current()->themeEngine()->paint( |
344 canvas, scrollbar.orientation() == HorizontalScrollbar | 345 canvas, scrollbar.orientation() == HorizontalScrollbar |
345 ? WebThemeEngine::PartScrollbarHorizontalThumb | 346 ? WebThemeEngine::PartScrollbarHorizontalThumb |
346 : WebThemeEngine::PartScrollbarVerticalThumb, | 347 : WebThemeEngine::PartScrollbarVerticalThumb, |
347 state, WebRect(rect), 0); | 348 state, WebRect(rect), nullptr); |
348 } | 349 } |
349 | 350 |
350 bool ScrollbarThemeAura::shouldRepaintAllPartsOnInvalidation() const { | 351 bool ScrollbarThemeAura::shouldRepaintAllPartsOnInvalidation() const { |
351 // This theme can separately handle thumb invalidation. | 352 // This theme can separately handle thumb invalidation. |
352 return false; | 353 return false; |
353 } | 354 } |
354 | 355 |
355 ScrollbarPart ScrollbarThemeAura::invalidateOnThumbPositionChange( | 356 ScrollbarPart ScrollbarThemeAura::invalidateOnThumbPositionChange( |
356 const ScrollbarThemeClient& scrollbar, | 357 const ScrollbarThemeClient& scrollbar, |
357 float oldPosition, | 358 float oldPosition, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } | 392 } |
392 | 393 |
393 // HorizontalScrollbar | 394 // HorizontalScrollbar |
394 int squareSize = scrollbar.height(); | 395 int squareSize = scrollbar.height(); |
395 return IntSize( | 396 return IntSize( |
396 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, | 397 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, |
397 squareSize); | 398 squareSize); |
398 } | 399 } |
399 | 400 |
400 } // namespace blink | 401 } // namespace blink |
OLD | NEW |