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

Side by Side Diff: ui/gfx/image/image_skia_operations.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 10 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 | « ui/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/nine_image_painter.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/image/image_skia_operations.h" 5 #include "ui/gfx/image/image_skia_operations.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 public: 402 public:
403 HorizontalShadowSource(const std::vector<ShadowValue>& shadows, 403 HorizontalShadowSource(const std::vector<ShadowValue>& shadows,
404 bool fades_down) 404 bool fades_down)
405 : CanvasImageSource(Size(1, GetHeightForShadows(shadows)), false), 405 : CanvasImageSource(Size(1, GetHeightForShadows(shadows)), false),
406 shadows_(shadows), 406 shadows_(shadows),
407 fades_down_(fades_down) {} 407 fades_down_(fades_down) {}
408 ~HorizontalShadowSource() override {} 408 ~HorizontalShadowSource() override {}
409 409
410 // CanvasImageSource overrides: 410 // CanvasImageSource overrides:
411 void Draw(Canvas* canvas) override { 411 void Draw(Canvas* canvas) override {
412 SkPaint paint; 412 cc::PaintFlags paint;
413 paint.setLooper(CreateShadowDrawLooperCorrectBlur(shadows_)); 413 paint.setLooper(CreateShadowDrawLooperCorrectBlur(shadows_));
414 canvas->DrawRect(RectF(0, fades_down_ ? -1 : size().height(), 1, 1), paint); 414 canvas->DrawRect(RectF(0, fades_down_ ? -1 : size().height(), 1, 1), paint);
415 } 415 }
416 416
417 private: 417 private:
418 static int GetHeightForShadows(const std::vector<ShadowValue>& shadows) { 418 static int GetHeightForShadows(const std::vector<ShadowValue>& shadows) {
419 int height = 0; 419 int height = 0;
420 for (const auto& shadow : shadows) { 420 for (const auto& shadow : shadows) {
421 height = std::max(height, shadow.y() + ToCeiledInt(shadow.blur() / 2)); 421 height = std::max(height, shadow.y() + ToCeiledInt(shadow.blur() / 2));
422 } 422 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 if (icon.isNull()) 618 if (icon.isNull())
619 return ImageSkia(); 619 return ImageSkia();
620 620
621 if (badge.isNull()) 621 if (badge.isNull())
622 return icon; 622 return icon;
623 623
624 return ImageSkia(new IconWithBadgeSource(icon, badge), icon.size()); 624 return ImageSkia(new IconWithBadgeSource(icon, badge), icon.size());
625 } 625 }
626 626
627 } // namespace gfx 627 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/nine_image_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698