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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleGeneratedImage.h

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 14 matching lines...) Expand all
25 #define StyleGeneratedImage_h 25 #define StyleGeneratedImage_h
26 26
27 #include "core/CoreExport.h" 27 #include "core/CoreExport.h"
28 #include "core/style/StyleImage.h" 28 #include "core/style/StyleImage.h"
29 29
30 namespace blink { 30 namespace blink {
31 31
32 class CSSValue; 32 class CSSValue;
33 class CSSImageGeneratorValue; 33 class CSSImageGeneratorValue;
34 class Document; 34 class Document;
35 class ImageResourceObserver;
35 36
36 class CORE_EXPORT StyleGeneratedImage final : public StyleImage { 37 class CORE_EXPORT StyleGeneratedImage final : public StyleImage {
37 public: 38 public:
38 static StyleGeneratedImage* Create(const CSSImageGeneratorValue& value) { 39 static StyleGeneratedImage* Create(const CSSImageGeneratorValue& value) {
39 return new StyleGeneratedImage(value); 40 return new StyleGeneratedImage(value);
40 } 41 }
41 42
42 WrappedImagePtr Data() const override { return image_generator_value_.Get(); } 43 WrappedImagePtr Data() const override { return image_generator_value_.Get(); }
43 44
44 CSSValue* CssValue() const override; 45 CSSValue* CssValue() const override;
45 CSSValue* ComputedCSSValue() const override; 46 CSSValue* ComputedCSSValue() const override;
46 47
47 LayoutSize ImageSize(const Document&, 48 LayoutSize ImageSize(const Document&,
48 float multiplier, 49 float multiplier,
49 const LayoutSize& default_object_size) const override; 50 const LayoutSize& default_object_size) const override;
50 bool ImageHasRelativeSize() const override { return !fixed_size_; } 51 bool ImageHasRelativeSize() const override { return !fixed_size_; }
51 bool UsesImageContainerSize() const override { return !fixed_size_; } 52 bool UsesImageContainerSize() const override { return !fixed_size_; }
52 void AddClient(LayoutObject*) override; 53 void AddClient(ImageResourceObserver*) override;
53 void RemoveClient(LayoutObject*) override; 54 void RemoveClient(ImageResourceObserver*) override;
54 PassRefPtr<Image> GetImage(const LayoutObject&, 55 PassRefPtr<Image> GetImage(const ImageResourceObserver&,
56 const Document&,
57 const ComputedStyle&,
55 const IntSize&) const override; 58 const IntSize&) const override;
56 bool KnownToBeOpaque(const Document&, const ComputedStyle&) const override; 59 bool KnownToBeOpaque(const Document&, const ComputedStyle&) const override;
57 60
58 DECLARE_VIRTUAL_TRACE(); 61 DECLARE_VIRTUAL_TRACE();
59 62
60 private: 63 private:
61 StyleGeneratedImage(const CSSImageGeneratorValue&); 64 StyleGeneratedImage(const CSSImageGeneratorValue&);
62 65
63 // TODO(sashab): Replace this with <const CSSImageGeneratorValue> once 66 // TODO(sashab): Replace this with <const CSSImageGeneratorValue> once
64 // Member<> supports const types. 67 // Member<> supports const types.
65 Member<CSSImageGeneratorValue> image_generator_value_; 68 Member<CSSImageGeneratorValue> image_generator_value_;
66 const bool fixed_size_; 69 const bool fixed_size_;
67 }; 70 };
68 71
69 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleGeneratedImage, IsGeneratedImage()); 72 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleGeneratedImage, IsGeneratedImage());
70 73
71 } // namespace blink 74 } // namespace blink
72 #endif 75 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698