Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 4 * Copyright 2014 The Chromium Authors. All rights reserved. | 4 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 virtual const char* renderName() const override { return "RenderSVGResourceP attern"; } | 45 virtual const char* renderName() const override { return "RenderSVGResourceP attern"; } |
| 46 | 46 |
| 47 virtual void removeAllClientsFromCache(bool markForInvalidation = true) over ride; | 47 virtual void removeAllClientsFromCache(bool markForInvalidation = true) over ride; |
| 48 virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) override; | 48 virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) override; |
| 49 | 49 |
| 50 virtual SVGPaintServer preparePaintServer(const RenderObject&) override; | 50 virtual SVGPaintServer preparePaintServer(const RenderObject&) override; |
| 51 | 51 |
| 52 static const RenderSVGResourceType s_resourceType = PatternResourceType; | 52 static const RenderSVGResourceType s_resourceType = PatternResourceType; |
| 53 virtual RenderSVGResourceType resourceType() const override { return s_resou rceType; } | 53 virtual RenderSVGResourceType resourceType() const override { return s_resou rceType; } |
| 54 | 54 |
| 55 virtual void trace(Visitor*) override; | |
| 56 | |
| 57 private: | 55 private: |
| 58 PassOwnPtr<PatternData> buildPatternData(const RenderObject&); | 56 PassOwnPtr<PatternData> buildPatternData(const RenderObject&); |
| 59 PassRefPtr<const SkPicture> asPicture(const FloatRect& tile, const AffineTra nsform&) const; | 57 PassRefPtr<const SkPicture> asPicture(const FloatRect& tile, const AffineTra nsform&) const; |
| 60 PatternData* patternForRenderer(const RenderObject&); | 58 PatternData* patternForRenderer(const RenderObject&); |
| 61 | 59 |
| 62 bool m_shouldCollectPatternAttributes : 1; | 60 bool m_shouldCollectPatternAttributes : 1; |
| 61 #if ENABLE(OILPAN) | |
| 62 Persistent<PatternAttributesWrapper> m_attributesWrapper; | |
|
haraken
2015/02/04 05:48:56
Can we avoid introducing a wrapper by making Patte
sof
2015/02/04 08:44:32
That would entail moving the value-based GradientA
haraken
2015/02/04 09:25:10
I thought we can just use OwnPtrWillBePersistent<P
| |
| 63 | |
| 64 PatternAttributes& mutableAttributes() { return m_attributesWrapper->attribu tes(); } | |
| 65 const PatternAttributes& attributes() const { return m_attributesWrapper->at tributes(); } | |
| 66 #else | |
| 63 PatternAttributes m_attributes; | 67 PatternAttributes m_attributes; |
| 64 | 68 |
| 69 PatternAttributes& mutableAttributes() { return m_attributes; } | |
| 70 const PatternAttributes& attributes() const { return m_attributes; } | |
| 71 #endif | |
| 72 | |
| 65 // FIXME: we can almost do away with this per-object map, but not quite: the tile size can be | 73 // FIXME: we can almost do away with this per-object map, but not quite: the tile size can be |
| 66 // relative to the client bounding box, and it gets captured in the cached P attern shader. | 74 // relative to the client bounding box, and it gets captured in the cached P attern shader. |
| 67 // Hence, we need one Pattern shader per client. The display list OTOH is th e same => we | 75 // Hence, we need one Pattern shader per client. The display list OTOH is th e same => we |
| 68 // should be able to cache a single display list per RenderSVGResourcePatter n + one | 76 // should be able to cache a single display list per RenderSVGResourcePatter n + one |
| 69 // Pattern(shader) for each client -- this would avoid re-recording when mul tiple clients | 77 // Pattern(shader) for each client -- this would avoid re-recording when mul tiple clients |
| 70 // share the same pattern. | 78 // share the same pattern. |
| 71 HashMap<const RenderObject*, OwnPtr<PatternData> > m_patternMap; | 79 HashMap<const RenderObject*, OwnPtr<PatternData>> m_patternMap; |
| 72 }; | 80 }; |
| 73 | 81 |
| 74 } | 82 } |
| 75 | 83 |
| 76 #endif | 84 #endif |
| OLD | NEW |