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

Side by Side Diff: ui/native_theme/native_theme_aura.cc

Issue 1539583003: Convert Pass()→std::move() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « ui/message_center/views/message_view.cc ('k') | ui/snapshot/snapshot_aura.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/native_theme/native_theme_aura.h" 5 #include "ui/native_theme/native_theme_aura.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility>
8 9
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "ui/base/layout.h" 11 #include "ui/base/layout.h"
11 #include "ui/base/nine_image_painter_factory.h" 12 #include "ui/base/nine_image_painter_factory.h"
12 #include "ui/base/resource/material_design/material_design_controller.h" 13 #include "ui/base/resource/material_design/material_design_controller.h"
13 #include "ui/gfx/canvas.h" 14 #include "ui/gfx/canvas.h"
14 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
16 #include "ui/gfx/image/image_skia.h" 17 #include "ui/gfx/image/image_skia.h"
17 #include "ui/gfx/nine_image_painter.h" 18 #include "ui/gfx/nine_image_painter.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 scoped_ptr<NativeThemeAura::DualPainter> NativeThemeAura::CreateDualPainter( 276 scoped_ptr<NativeThemeAura::DualPainter> NativeThemeAura::CreateDualPainter(
276 const int fill_image_ids[9], 277 const int fill_image_ids[9],
277 const uint8 fill_alphas[kNumStates], 278 const uint8 fill_alphas[kNumStates],
278 const int stroke_image_ids[9], 279 const int stroke_image_ids[9],
279 const uint8 stroke_alphas[kNumStates]) const { 280 const uint8 stroke_alphas[kNumStates]) const {
280 scoped_ptr<NativeThemeAura::DualPainter> dual_painter( 281 scoped_ptr<NativeThemeAura::DualPainter> dual_painter(
281 new NativeThemeAura::DualPainter(CreateNineImagePainter(fill_image_ids), 282 new NativeThemeAura::DualPainter(CreateNineImagePainter(fill_image_ids),
282 fill_alphas, 283 fill_alphas,
283 CreateNineImagePainter(stroke_image_ids), 284 CreateNineImagePainter(stroke_image_ids),
284 stroke_alphas)); 285 stroke_alphas));
285 return dual_painter.Pass(); 286 return dual_painter;
286 } 287 }
287 288
288 void NativeThemeAura::PaintDualPainter( 289 void NativeThemeAura::PaintDualPainter(
289 NativeThemeAura::DualPainter* dual_painter, 290 NativeThemeAura::DualPainter* dual_painter,
290 SkCanvas* sk_canvas, 291 SkCanvas* sk_canvas,
291 const gfx::Rect& rect, 292 const gfx::Rect& rect,
292 State state) const { 293 State state) const {
293 DCHECK(dual_painter); 294 DCHECK(dual_painter);
294 scoped_ptr<gfx::Canvas> canvas(CommonThemeCreateCanvas(sk_canvas)); 295 scoped_ptr<gfx::Canvas> canvas(CommonThemeCreateCanvas(sk_canvas));
295 dual_painter->fill_painter->Paint( 296 dual_painter->fill_painter->Paint(
(...skipping 22 matching lines...) Expand all
318 319
319 dual_painter->fill_painter->Paint(canvas.get(), rect, fill_alpha); 320 dual_painter->fill_painter->Paint(canvas.get(), rect, fill_alpha);
320 dual_painter->stroke_painter->Paint(canvas.get(), rect, stroke_alpha); 321 dual_painter->stroke_painter->Paint(canvas.get(), rect, stroke_alpha);
321 } 322 }
322 323
323 NativeThemeAura::DualPainter::DualPainter( 324 NativeThemeAura::DualPainter::DualPainter(
324 scoped_ptr<NineImagePainter> fill_painter, 325 scoped_ptr<NineImagePainter> fill_painter,
325 const uint8 fill_alphas[kNumStates], 326 const uint8 fill_alphas[kNumStates],
326 scoped_ptr<NineImagePainter> stroke_painter, 327 scoped_ptr<NineImagePainter> stroke_painter,
327 const uint8 stroke_alphas[kNumStates]) 328 const uint8 stroke_alphas[kNumStates])
328 : fill_painter(fill_painter.Pass()), 329 : fill_painter(std::move(fill_painter)),
329 fill_alphas(fill_alphas), 330 fill_alphas(fill_alphas),
330 stroke_painter(stroke_painter.Pass()), 331 stroke_painter(std::move(stroke_painter)),
331 stroke_alphas(stroke_alphas) {} 332 stroke_alphas(stroke_alphas) {}
332 333
333 NativeThemeAura::DualPainter::~DualPainter() {} 334 NativeThemeAura::DualPainter::~DualPainter() {}
334 335
335 } // namespace ui 336 } // namespace ui
OLDNEW
« no previous file with comments | « ui/message_center/views/message_view.cc ('k') | ui/snapshot/snapshot_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698