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

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

Issue 9544001: ui: Let skia do the conversion work for us by using the integer version of set() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify FocusableBorder::Paint Created 8 years, 9 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 | « no previous file | ui/gfx/native_theme_android.cc » ('j') | ui/gfx/native_theme_android.cc » ('J')
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_skia.h" 5 #include "ui/gfx/canvas_skia.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void CanvasSkia::Save() { 107 void CanvasSkia::Save() {
108 canvas_->save(); 108 canvas_->save();
109 } 109 }
110 110
111 void CanvasSkia::SaveLayerAlpha(uint8 alpha) { 111 void CanvasSkia::SaveLayerAlpha(uint8 alpha) {
112 canvas_->saveLayerAlpha(NULL, alpha); 112 canvas_->saveLayerAlpha(NULL, alpha);
113 } 113 }
114 114
115 115
116 void CanvasSkia::SaveLayerAlpha(uint8 alpha, const gfx::Rect& layer_bounds) { 116 void CanvasSkia::SaveLayerAlpha(uint8 alpha, const gfx::Rect& layer_bounds) {
117 SkRect bounds; 117 SkRect bounds(gfx::RectToSkRect(layer_bounds));
118 bounds.set(SkIntToScalar(layer_bounds.x()),
119 SkIntToScalar(layer_bounds.y()),
120 SkIntToScalar(layer_bounds.right()),
121 SkIntToScalar(layer_bounds.bottom()));
122 canvas_->saveLayerAlpha(&bounds, alpha); 118 canvas_->saveLayerAlpha(&bounds, alpha);
123 } 119 }
124 120
125 void CanvasSkia::Restore() { 121 void CanvasSkia::Restore() {
126 canvas_->restore(); 122 canvas_->restore();
127 } 123 }
128 124
129 bool CanvasSkia::ClipRect(const gfx::Rect& rect) { 125 bool CanvasSkia::ClipRect(const gfx::Rect& rect) {
130 return canvas_->clipRect(gfx::RectToSkRect(rect)); 126 return canvas_->clipRect(gfx::RectToSkRect(rect));
131 } 127 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 394
399 Canvas* Canvas::CreateCanvas() { 395 Canvas* Canvas::CreateCanvas() {
400 return new CanvasSkia; 396 return new CanvasSkia;
401 } 397 }
402 398
403 Canvas* Canvas::CreateCanvas(const gfx::Size& size, bool is_opaque) { 399 Canvas* Canvas::CreateCanvas(const gfx::Size& size, bool is_opaque) {
404 return new CanvasSkia(size, is_opaque); 400 return new CanvasSkia(size, is_opaque);
405 } 401 }
406 402
407 } // namespace gfx 403 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/native_theme_android.cc » ('j') | ui/gfx/native_theme_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698