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

Side by Side Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 418483004: Fix scrollbar damage accumulation issue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 6 years, 5 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/platform/scroll/ScrollableArea.h ('k') | no next file » | 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 29 matching lines...) Expand all
40 40
41 #include "platform/TraceEvent.h" 41 #include "platform/TraceEvent.h"
42 42
43 static const int kPixelsPerLineStep = 40; 43 static const int kPixelsPerLineStep = 40;
44 static const float kMinFractionToStepWhenPaging = 0.875f; 44 static const float kMinFractionToStepWhenPaging = 0.875f;
45 45
46 namespace blink { 46 namespace blink {
47 47
48 struct SameSizeAsScrollableArea { 48 struct SameSizeAsScrollableArea {
49 virtual ~SameSizeAsScrollableArea(); 49 virtual ~SameSizeAsScrollableArea();
50 unsigned damageBits : 2;
51 IntRect scrollbarDamage[2]; 50 IntRect scrollbarDamage[2];
52 void* pointer; 51 void* pointer;
53 unsigned bitfields : 16; 52 unsigned bitfields : 16;
54 IntPoint origin; 53 IntPoint origin;
55 }; 54 };
56 55
57 COMPILE_ASSERT(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), Scrol lableArea_should_stay_small); 56 COMPILE_ASSERT(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), Scrol lableArea_should_stay_small);
58 57
59 int ScrollableArea::pixelsPerLineStep() 58 int ScrollableArea::pixelsPerLineStep()
60 { 59 {
61 return kPixelsPerLineStep; 60 return kPixelsPerLineStep;
62 } 61 }
63 62
64 float ScrollableArea::minFractionToStepWhenPaging() 63 float ScrollableArea::minFractionToStepWhenPaging()
65 { 64 {
66 return kMinFractionToStepWhenPaging; 65 return kMinFractionToStepWhenPaging;
67 } 66 }
68 67
69 int ScrollableArea::maxOverlapBetweenPages() 68 int ScrollableArea::maxOverlapBetweenPages()
70 { 69 {
71 static int maxOverlapBetweenPages = ScrollbarTheme::theme()->maxOverlapBetwe enPages(); 70 static int maxOverlapBetweenPages = ScrollbarTheme::theme()->maxOverlapBetwe enPages();
72 return maxOverlapBetweenPages; 71 return maxOverlapBetweenPages;
73 } 72 }
74 73
75 ScrollableArea::ScrollableArea() 74 ScrollableArea::ScrollableArea()
76 : m_hasHorizontalBarDamage(false) 75 : m_constrainsScrollingToContentEdge(true)
77 , m_hasVerticalBarDamage(false)
78 , m_constrainsScrollingToContentEdge(true)
79 , m_inLiveResize(false) 76 , m_inLiveResize(false)
80 , m_verticalScrollElasticity(ScrollElasticityNone) 77 , m_verticalScrollElasticity(ScrollElasticityNone)
81 , m_horizontalScrollElasticity(ScrollElasticityNone) 78 , m_horizontalScrollElasticity(ScrollElasticityNone)
82 , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault) 79 , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault)
83 , m_scrollOriginChanged(false) 80 , m_scrollOriginChanged(false)
84 { 81 {
85 } 82 }
86 83
87 ScrollableArea::~ScrollableArea() 84 ScrollableArea::~ScrollableArea()
88 { 85 {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 { 470 {
474 return scrollSize(orientation); 471 return scrollSize(orientation);
475 } 472 }
476 473
477 float ScrollableArea::pixelStep(ScrollbarOrientation) const 474 float ScrollableArea::pixelStep(ScrollbarOrientation) const
478 { 475 {
479 return 1; 476 return 1;
480 } 477 }
481 478
482 } // namespace blink 479 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698