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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp

Issue 2824263002: Replace getBaseLayerSize() with the size passed to DrawingRecorder. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 part = WebThemeEngine::kPartScrollbarVerticalThumb; 202 part = WebThemeEngine::kPartScrollbarVerticalThumb;
203 203
204 blink::WebThemeEngine::ExtraParams params; 204 blink::WebThemeEngine::ExtraParams params;
205 params.scrollbar_thumb.scrollbar_theme = 205 params.scrollbar_thumb.scrollbar_theme =
206 static_cast<WebScrollbarOverlayColorTheme>( 206 static_cast<WebScrollbarOverlayColorTheme>(
207 scrollbar.GetScrollbarOverlayColorTheme()); 207 scrollbar.GetScrollbarOverlayColorTheme());
208 208
209 // Horizontally flip the canvas if it is left vertical scrollbar. 209 // Horizontally flip the canvas if it is left vertical scrollbar.
210 if (scrollbar.IsLeftSideVerticalScrollbar()) { 210 if (scrollbar.IsLeftSideVerticalScrollbar()) {
211 canvas->save(); 211 canvas->save();
212 canvas->translate(canvas->getBaseLayerSize().width(), 0); 212 canvas->translate(rect.Width(), 0);
213 canvas->scale(-1, 1); 213 canvas->scale(-1, 1);
214 } 214 }
215 215
216 Platform::Current()->ThemeEngine()->Paint(canvas, part, state, WebRect(rect), 216 Platform::Current()->ThemeEngine()->Paint(canvas, part, state, WebRect(rect),
217 &params); 217 &params);
218 218
219 if (scrollbar.IsLeftSideVerticalScrollbar()) 219 if (scrollbar.IsLeftSideVerticalScrollbar()) {
220 canvas->clear(SK_ColorRED);
danakj 2017/04/18 19:27:12 Oops bonus clear for testing.
220 canvas->restore(); 221 canvas->restore();
222 }
221 } 223 }
222 224
223 ScrollbarPart ScrollbarThemeOverlay::HitTest( 225 ScrollbarPart ScrollbarThemeOverlay::HitTest(
224 const ScrollbarThemeClient& scrollbar, 226 const ScrollbarThemeClient& scrollbar,
225 const IntPoint& position) { 227 const IntPoint& position) {
226 if (allow_hit_test_ == kDisallowHitTest) 228 if (allow_hit_test_ == kDisallowHitTest)
227 return kNoPart; 229 return kNoPart;
228 230
229 ScrollbarPart part = ScrollbarTheme::HitTest(scrollbar, position); 231 ScrollbarPart part = ScrollbarTheme::HitTest(scrollbar, position);
230 if (part != kThumbPart) 232 if (part != kThumbPart)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 .height; 292 .height;
291 } 293 }
292 294
293 return Platform::Current() 295 return Platform::Current()
294 ->ThemeEngine() 296 ->ThemeEngine()
295 ->GetSize(WebThemeEngine::kPartScrollbarHorizontalThumb) 297 ->GetSize(WebThemeEngine::kPartScrollbarHorizontalThumb)
296 .width; 298 .width;
297 } 299 }
298 300
299 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698