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

Side by Side Diff: chrome/browser/download/download_shelf.cc

Issue 771563003: use SkClipOps where we can, legacyClip where we need to rework Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "chrome/browser/download/download_shelf.h" 7 #include "chrome/browser/download/download_shelf.h"
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 SkIntToScalar(bounds.x() + image_size), 133 SkIntToScalar(bounds.x() + image_size),
134 SkIntToScalar(bounds.y() + image_size)); 134 SkIntToScalar(bounds.y() + image_size));
135 SkPath path; 135 SkPath path;
136 path.arcTo(oval, 136 path.arcTo(oval,
137 SkFloatToScalar(start_pos), 137 SkFloatToScalar(start_pos),
138 SkFloatToScalar(sweep_angle), false); 138 SkFloatToScalar(sweep_angle), false);
139 path.lineTo(SkIntToScalar(bounds.x() + image_size / 2), 139 path.lineTo(SkIntToScalar(bounds.x() + image_size / 2),
140 SkIntToScalar(bounds.y() + image_size / 2)); 140 SkIntToScalar(bounds.y() + image_size / 2));
141 141
142 // gfx::Canvas::ClipPath does not provide for anti-aliasing. 142 // gfx::Canvas::ClipPath does not provide for anti-aliasing.
143 canvas->sk_canvas()->clipPath(path, SkRegion::kIntersect_Op, true); 143 canvas->sk_canvas()->clipPath(path, kIntersect_SkClipOp, true);
144 } 144 }
145 145
146 canvas->DrawImageInt(foreground_image, 146 canvas->DrawImageInt(foreground_image,
147 bounds.x(), 147 bounds.x(),
148 bounds.y()); 148 bounds.y());
149 canvas->Restore(); 149 canvas->Restore();
150 } 150 }
151 151
152 // static 152 // static
153 void DownloadShelf::PaintDownloadProgress( 153 void DownloadShelf::PaintDownloadProgress(
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 content::DownloadManager* download_manager = GetDownloadManager(); 355 content::DownloadManager* download_manager = GetDownloadManager();
356 if (!download_manager) 356 if (!download_manager)
357 return; 357 return;
358 358
359 DownloadItem* download = download_manager->GetDownload(download_id); 359 DownloadItem* download = download_manager->GetDownload(download_id);
360 if (!download) 360 if (!download)
361 return; 361 return;
362 362
363 ShowDownload(download); 363 ShowDownload(download);
364 } 364 }
OLDNEW
« no previous file with comments | « cc/resources/raster_source_helper.cc ('k') | content/browser/compositor/software_output_device_ozone_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698