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

Side by Side Diff: ui/gfx/canvas.cc

Issue 290333012: [Win] Draw the circular avatar programmatically rather than with a frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing virtual keyword Created 6 years, 7 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 | « ui/gfx/canvas.h ('k') | ui/views/controls/progress_bar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ui/gfx/canvas.h" 5 #include "ui/gfx/canvas.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 void Canvas::Save() { 179 void Canvas::Save() {
180 canvas_->save(); 180 canvas_->save();
181 } 181 }
182 182
183 void Canvas::SaveLayerAlpha(uint8 alpha) { 183 void Canvas::SaveLayerAlpha(uint8 alpha) {
184 canvas_->saveLayerAlpha(NULL, alpha); 184 canvas_->saveLayerAlpha(NULL, alpha);
185 } 185 }
186 186
187
188 void Canvas::SaveLayerAlpha(uint8 alpha, const Rect& layer_bounds) { 187 void Canvas::SaveLayerAlpha(uint8 alpha, const Rect& layer_bounds) {
189 SkRect bounds(RectToSkRect(layer_bounds)); 188 SkRect bounds(RectToSkRect(layer_bounds));
190 canvas_->saveLayerAlpha(&bounds, alpha); 189 canvas_->saveLayerAlpha(&bounds, alpha);
191 } 190 }
192 191
193 void Canvas::Restore() { 192 void Canvas::Restore() {
194 canvas_->restore(); 193 canvas_->restore();
195 } 194 }
196 195
197 void Canvas::ClipRect(const Rect& rect) { 196 void Canvas::ClipRect(const Rect& rect) {
198 canvas_->clipRect(RectToSkRect(rect)); 197 canvas_->clipRect(RectToSkRect(rect));
199 } 198 }
200 199
201 void Canvas::ClipPath(const SkPath& path) { 200 void Canvas::ClipPath(const SkPath& path, bool do_anti_alias) {
202 canvas_->clipPath(path); 201 canvas_->clipPath(path, SkRegion::kIntersect_Op, do_anti_alias);
203 } 202 }
204 203
205 bool Canvas::IsClipEmpty() const { 204 bool Canvas::IsClipEmpty() const {
206 return canvas_->isClipEmpty(); 205 return canvas_->isClipEmpty();
207 } 206 }
208 207
209 bool Canvas::GetClipBounds(Rect* bounds) { 208 bool Canvas::GetClipBounds(Rect* bounds) {
210 SkRect out; 209 SkRect out;
211 bool has_non_empty_clip = canvas_->getClipBounds(&out); 210 bool has_non_empty_clip = canvas_->getClipBounds(&out);
212 bounds->SetRect(out.left(), out.top(), out.width(), out.height()); 211 bounds->SetRect(out.left(), out.top(), out.width(), out.height());
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 SkPaint p(paint); 627 SkPaint p(paint);
629 p.setFilterLevel(filter ? SkPaint::kLow_FilterLevel 628 p.setFilterLevel(filter ? SkPaint::kLow_FilterLevel
630 : SkPaint::kNone_FilterLevel); 629 : SkPaint::kNone_FilterLevel);
631 p.setShader(shader.get()); 630 p.setShader(shader.get());
632 631
633 // The rect will be filled by the bitmap. 632 // The rect will be filled by the bitmap.
634 canvas_->drawRect(dest_rect, p); 633 canvas_->drawRect(dest_rect, p);
635 } 634 }
636 635
637 } // namespace gfx 636 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/canvas.h ('k') | ui/views/controls/progress_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698