Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: Source/core/layout/LayoutThemeDefault.cpp

Issue 952593003: Remove argument to progress bar timing methods on LayoutTheme. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutThemeDefault.h ('k') | Source/core/layout/LayoutThemeMac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * Copyright (C) 2009 Kenneth Rohde Christiansen 6 * Copyright (C) 2009 Kenneth Rohde Christiansen
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 int movableWidth = rect.width() - valueWidth; 828 int movableWidth = rect.width() - valueWidth;
829 if (movableWidth <= 0) 829 if (movableWidth <= 0)
830 return IntRect(); 830 return IntRect();
831 831
832 double progress = renderProgress->animationProgress(); 832 double progress = renderProgress->animationProgress();
833 if (progress < 0.5) 833 if (progress < 0.5)
834 return IntRect(rect.x() + progress * 2 * movableWidth, rect.y(), valueWi dth, rect.height()); 834 return IntRect(rect.x() + progress * 2 * movableWidth, rect.y(), valueWi dth, rect.height());
835 return IntRect(rect.x() + (1.0 - progress) * 2 * movableWidth, rect.y(), val ueWidth, rect.height()); 835 return IntRect(rect.x() + (1.0 - progress) * 2 * movableWidth, rect.y(), val ueWidth, rect.height());
836 } 836 }
837 837
838 double LayoutThemeDefault::animationRepeatIntervalForProgressBar(LayoutProgress* ) const 838 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const
839 { 839 {
840 return progressAnimationInterval; 840 return progressAnimationInterval;
841 } 841 }
842 842
843 double LayoutThemeDefault::animationDurationForProgressBar(LayoutProgress* rende rProgress) const 843 double LayoutThemeDefault::animationDurationForProgressBar() const
844 { 844 {
845 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b ack and forth 845 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b ack and forth
846 } 846 }
847 847
848 IntRect LayoutThemeDefault::progressValueRectFor(LayoutProgress* renderProgress, const IntRect& rect) const 848 IntRect LayoutThemeDefault::progressValueRectFor(LayoutProgress* renderProgress, const IntRect& rect) const
849 { 849 {
850 return renderProgress->isDeterminate() ? determinateProgressValueRectFor(ren derProgress, rect) : indeterminateProgressValueRectFor(renderProgress, rect); 850 return renderProgress->isDeterminate() ? determinateProgressValueRectFor(ren derProgress, rect) : indeterminateProgressValueRectFor(renderProgress, rect);
851 } 851 }
852 852
853 LayoutThemeDefault::DirectionFlippingScope::DirectionFlippingScope(LayoutObject* renderer, const PaintInfo& paintInfo, const IntRect& rect) 853 LayoutThemeDefault::DirectionFlippingScope::DirectionFlippingScope(LayoutObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
854 : m_needsFlipping(!renderer->style()->isLeftToRightDirection()) 854 : m_needsFlipping(!renderer->style()->isLeftToRightDirection())
855 , m_paintInfo(paintInfo) 855 , m_paintInfo(paintInfo)
856 { 856 {
857 if (!m_needsFlipping) 857 if (!m_needsFlipping)
858 return; 858 return;
859 m_paintInfo.context->save(); 859 m_paintInfo.context->save();
860 m_paintInfo.context->translate(2 * rect.x() + rect.width(), 0); 860 m_paintInfo.context->translate(2 * rect.x() + rect.width(), 0);
861 m_paintInfo.context->scale(-1, 1); 861 m_paintInfo.context->scale(-1, 1);
862 } 862 }
863 863
864 LayoutThemeDefault::DirectionFlippingScope::~DirectionFlippingScope() 864 LayoutThemeDefault::DirectionFlippingScope::~DirectionFlippingScope()
865 { 865 {
866 if (!m_needsFlipping) 866 if (!m_needsFlipping)
867 return; 867 return;
868 m_paintInfo.context->restore(); 868 m_paintInfo.context->restore();
869 } 869 }
870 870
871 } // namespace blink 871 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutThemeDefault.h ('k') | Source/core/layout/LayoutThemeMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698