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

Side by Side Diff: content/shell/renderer/test_runner/mock_web_theme_engine.cc

Issue 814123003: Add handling for Skia's SkPath::intersect's return value (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed braces Created 5 years, 11 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 | « chrome/browser/ui/views/tabs/tab.cc ('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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/test_runner/mock_web_theme_engine.h" 5 #include "content/shell/renderer/test_runner/mock_web_theme_engine.h"
6 6
7 #if !defined(OS_MACOSX) 7 #if !defined(OS_MACOSX)
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 SkIRect tofill = irect; 621 SkIRect tofill = irect;
622 if (extraParams->progressBar.determinate) { 622 if (extraParams->progressBar.determinate) {
623 tofill.set(extraParams->progressBar.valueRectX, 623 tofill.set(extraParams->progressBar.valueRectX,
624 extraParams->progressBar.valueRectY, 624 extraParams->progressBar.valueRectY,
625 extraParams->progressBar.valueRectX + 625 extraParams->progressBar.valueRectX +
626 extraParams->progressBar.valueRectWidth - 1, 626 extraParams->progressBar.valueRectWidth - 1,
627 extraParams->progressBar.valueRectY + 627 extraParams->progressBar.valueRectY +
628 extraParams->progressBar.valueRectHeight); 628 extraParams->progressBar.valueRectHeight);
629 } 629 }
630 630
631 tofill.intersect(irect, tofill); 631 if (!tofill.intersect(irect))
632 tofill.setEmpty();
633
632 paint.setColor(edgeColor); 634 paint.setColor(edgeColor);
633 paint.setStyle(SkPaint::kFill_Style); 635 paint.setStyle(SkPaint::kFill_Style);
634 canvas->drawIRect(tofill, paint); 636 canvas->drawIRect(tofill, paint);
635 637
636 markState(canvas, irect, state); 638 markState(canvas, irect, state);
637 break; 639 break;
638 } 640 }
639 default: 641 default:
640 // FIXME: Should we do something here to indicate that we got an invalid part? 642 // FIXME: Should we do something here to indicate that we got an invalid part?
641 // Unfortunately, we can't assert because we don't have access to WTF or base. 643 // Unfortunately, we can't assert because we don't have access to WTF or base.
642 break; 644 break;
643 } 645 }
644 } 646 }
645 647
646 } // namespace content 648 } // namespace content
647 649
648 #endif // !defined(OS_MACOSX) 650 #endif // !defined(OS_MACOSX)
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698