| OLD | NEW |
| 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 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 } | 418 } |
| 419 | 419 |
| 420 bool RenderThemeChromiumSkia::shouldShowPlaceholderWhenFocused() const | 420 bool RenderThemeChromiumSkia::shouldShowPlaceholderWhenFocused() const |
| 421 { | 421 { |
| 422 return true; | 422 return true; |
| 423 } | 423 } |
| 424 | 424 |
| 425 // | 425 // |
| 426 // Following values are come from default of GTK+ | 426 // Following values are come from default of GTK+ |
| 427 // | 427 // |
| 428 static const int progressDeltaPixelsPerSecond = 100; | |
| 429 static const int progressActivityBlocks = 5; | 428 static const int progressActivityBlocks = 5; |
| 430 static const int progressAnimationFrmaes = 10; | 429 static const int progressAnimationFrames = 10; |
| 431 static const double progressAnimationInterval = 0.125; | 430 static const double progressAnimationInterval = 0.125; |
| 432 | 431 |
| 433 IntRect RenderThemeChromiumSkia::determinateProgressValueRectFor(RenderProgress*
renderProgress, const IntRect& rect) const | 432 IntRect RenderThemeChromiumSkia::determinateProgressValueRectFor(RenderProgress*
renderProgress, const IntRect& rect) const |
| 434 { | 433 { |
| 435 int dx = rect.width() * renderProgress->position(); | 434 int dx = rect.width() * renderProgress->position(); |
| 436 return IntRect(rect.x(), rect.y(), dx, rect.height()); | 435 return IntRect(rect.x(), rect.y(), dx, rect.height()); |
| 437 } | 436 } |
| 438 | 437 |
| 439 IntRect RenderThemeChromiumSkia::indeterminateProgressValueRectFor(RenderProgres
s* renderProgress, const IntRect& rect) const | 438 IntRect RenderThemeChromiumSkia::indeterminateProgressValueRectFor(RenderProgres
s* renderProgress, const IntRect& rect) const |
| 440 { | 439 { |
| 441 | 440 |
| 442 int valueWidth = rect.width() / progressActivityBlocks; | 441 int valueWidth = rect.width() / progressActivityBlocks; |
| 443 int movableWidth = rect.width() - valueWidth; | 442 int movableWidth = rect.width() - valueWidth; |
| 444 if (movableWidth <= 0) | 443 if (movableWidth <= 0) |
| 445 return IntRect(); | 444 return IntRect(); |
| 446 | 445 |
| 447 double progress = renderProgress->animationProgress(); | 446 double progress = renderProgress->animationProgress(); |
| 448 if (progress < 0.5) | 447 if (progress < 0.5) |
| 449 return IntRect(rect.x() + progress * 2 * movableWidth, rect.y(), valueWi
dth, rect.height()); | 448 return IntRect(rect.x() + progress * 2 * movableWidth, rect.y(), valueWi
dth, rect.height()); |
| 450 return IntRect(rect.x() + (1.0 - progress) * 2 * movableWidth, rect.y(), val
ueWidth, rect.height()); | 449 return IntRect(rect.x() + (1.0 - progress) * 2 * movableWidth, rect.y(), val
ueWidth, rect.height()); |
| 451 } | 450 } |
| 452 | 451 |
| 453 double RenderThemeChromiumSkia::animationRepeatIntervalForProgressBar(RenderProg
ress*) const | 452 double RenderThemeChromiumSkia::animationRepeatIntervalForProgressBar(RenderProg
ress*) const |
| 454 { | 453 { |
| 455 return progressAnimationInterval; | 454 return progressAnimationInterval; |
| 456 } | 455 } |
| 457 | 456 |
| 458 double RenderThemeChromiumSkia::animationDurationForProgressBar(RenderProgress*
renderProgress) const | 457 double RenderThemeChromiumSkia::animationDurationForProgressBar(RenderProgress*
renderProgress) const |
| 459 { | 458 { |
| 460 return progressAnimationInterval * progressAnimationFrmaes * 2; // "2" for b
ack and forth | 459 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b
ack and forth |
| 461 } | 460 } |
| 462 | 461 |
| 463 IntRect RenderThemeChromiumSkia::progressValueRectFor(RenderProgress* renderProg
ress, const IntRect& rect) const | 462 IntRect RenderThemeChromiumSkia::progressValueRectFor(RenderProgress* renderProg
ress, const IntRect& rect) const |
| 464 { | 463 { |
| 465 return renderProgress->isDeterminate() ? determinateProgressValueRectFor(ren
derProgress, rect) : indeterminateProgressValueRectFor(renderProgress, rect); | 464 return renderProgress->isDeterminate() ? determinateProgressValueRectFor(ren
derProgress, rect) : indeterminateProgressValueRectFor(renderProgress, rect); |
| 466 } | 465 } |
| 467 | 466 |
| 468 RenderThemeChromiumSkia::DirectionFlippingScope::DirectionFlippingScope(RenderOb
ject* renderer, const PaintInfo& paintInfo, const IntRect& rect) | 467 RenderThemeChromiumSkia::DirectionFlippingScope::DirectionFlippingScope(RenderOb
ject* renderer, const PaintInfo& paintInfo, const IntRect& rect) |
| 469 : m_needsFlipping(!renderer->style()->isLeftToRightDirection()) | 468 : m_needsFlipping(!renderer->style()->isLeftToRightDirection()) |
| 470 , m_paintInfo(paintInfo) | 469 , m_paintInfo(paintInfo) |
| 471 { | 470 { |
| 472 if (!m_needsFlipping) | 471 if (!m_needsFlipping) |
| 473 return; | 472 return; |
| 474 m_paintInfo.context->save(); | 473 m_paintInfo.context->save(); |
| 475 m_paintInfo.context->translate(2 * rect.x() + rect.width(), 0); | 474 m_paintInfo.context->translate(2 * rect.x() + rect.width(), 0); |
| 476 m_paintInfo.context->scale(FloatSize(-1, 1)); | 475 m_paintInfo.context->scale(FloatSize(-1, 1)); |
| 477 } | 476 } |
| 478 | 477 |
| 479 RenderThemeChromiumSkia::DirectionFlippingScope::~DirectionFlippingScope() | 478 RenderThemeChromiumSkia::DirectionFlippingScope::~DirectionFlippingScope() |
| 480 { | 479 { |
| 481 if (!m_needsFlipping) | 480 if (!m_needsFlipping) |
| 482 return; | 481 return; |
| 483 m_paintInfo.context->restore(); | 482 m_paintInfo.context->restore(); |
| 484 } | 483 } |
| 485 | 484 |
| 486 } // namespace WebCore | 485 } // namespace WebCore |
| OLD | NEW |