| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 class CanvasStyle final : public GarbageCollected<CanvasStyle> { | 42 class CanvasStyle final : public GarbageCollected<CanvasStyle> { |
| 43 public: | 43 public: |
| 44 static CanvasStyle* CreateFromRGBA(RGBA32 rgba) { | 44 static CanvasStyle* CreateFromRGBA(RGBA32 rgba) { |
| 45 return new CanvasStyle(rgba); | 45 return new CanvasStyle(rgba); |
| 46 } | 46 } |
| 47 static CanvasStyle* CreateFromGradient(CanvasGradient*); | 47 static CanvasStyle* CreateFromGradient(CanvasGradient*); |
| 48 static CanvasStyle* CreateFromPattern(CanvasPattern*); | 48 static CanvasStyle* CreateFromPattern(CanvasPattern*); |
| 49 | 49 |
| 50 String GetColor() const { | 50 String GetColor() const { |
| 51 ASSERT(type_ == kColorRGBA); | 51 DCHECK_EQ(type_, kColorRGBA); |
| 52 return Color(rgba_).Serialized(); | 52 return Color(rgba_).Serialized(); |
| 53 } | 53 } |
| 54 CanvasGradient* GetCanvasGradient() const { return gradient_.Get(); } | 54 CanvasGradient* GetCanvasGradient() const { return gradient_.Get(); } |
| 55 CanvasPattern* GetCanvasPattern() const { return pattern_; } | 55 CanvasPattern* GetCanvasPattern() const { return pattern_; } |
| 56 | 56 |
| 57 void ApplyToFlags(PaintFlags&) const; | 57 void ApplyToFlags(PaintFlags&) const; |
| 58 RGBA32 PaintColor() const; | 58 RGBA32 PaintColor() const; |
| 59 | 59 |
| 60 bool IsEquivalentRGBA(RGBA32 rgba) const { | 60 bool IsEquivalentRGBA(RGBA32 rgba) const { |
| 61 return type_ == kColorRGBA && rgba_ == rgba; | 61 return type_ == kColorRGBA && rgba_ == rgba; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 77 Member<CanvasPattern> pattern_; | 77 Member<CanvasPattern> pattern_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 bool ParseColorOrCurrentColor(Color& parsed_color, | 80 bool ParseColorOrCurrentColor(Color& parsed_color, |
| 81 const String& color_string, | 81 const String& color_string, |
| 82 HTMLCanvasElement*); | 82 HTMLCanvasElement*); |
| 83 | 83 |
| 84 } // namespace blink | 84 } // namespace blink |
| 85 | 85 |
| 86 #endif | 86 #endif |
| OLD | NEW |