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) 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 | 78 |
| 79 enum OpacityMode { | 79 enum OpacityMode { |
| 80 NonOpaque, | 80 NonOpaque, |
| 81 Opaque, | 81 Opaque, |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 class ImageBuffer { | 84 class ImageBuffer { |
| 85 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; | 85 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; |
| 86 public: | 86 public: |
| 87 // Will return a null pointer on allocation failure. | 87 // Will return a null pointer on allocation failure. |
| 88 static PassOwnPtr<ImageBuffer> create(const IntSize& size, float resolutionS cale = 1, RenderingMode renderingMode = Unaccelerated, OpacityMode opacityMode = NonOpaque) | 88 static PassOwnPtr<ImageBuffer> create(const IntSize& size, float resolutionS cale = 1, RenderingMode renderingMode = Unaccelerated, OpacityMode opacityMode = NonOpaque, int acceleratedMSAASampleCount = 0) |
| 89 { | 89 { |
| 90 bool success = false; | 90 bool success = false; |
| 91 OwnPtr<ImageBuffer> buf = adoptPtr(new ImageBuffer(size, resolutionScale , renderingMode, opacityMode, success)); | 91 OwnPtr<ImageBuffer> buf = adoptPtr(new ImageBuffer(size, resolutionScale , renderingMode, opacityMode, acceleratedMSAASampleCount, success)); |
| 92 if (!success) | 92 if (!success) |
| 93 return nullptr; | 93 return nullptr; |
| 94 return buf.release(); | 94 return buf.release(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, bool hasAlpha); | 97 static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, bool hasAlpha); |
| 98 | 98 |
| 99 ~ImageBuffer(); | 99 ~ImageBuffer(); |
| 100 | 100 |
| 101 // The actual resolution of the backing store | 101 // The actual resolution of the backing store |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 | 141 |
| 142 IntSize m_size; | 142 IntSize m_size; |
| 143 IntSize m_logicalSize; | 143 IntSize m_logicalSize; |
| 144 float m_resolutionScale; | 144 float m_resolutionScale; |
| 145 RefPtr<SkCanvas> m_canvas; | 145 RefPtr<SkCanvas> m_canvas; |
| 146 OwnPtr<GraphicsContext> m_context; | 146 OwnPtr<GraphicsContext> m_context; |
| 147 Canvas2DLayerBridgePtr m_layerBridge; | 147 Canvas2DLayerBridgePtr m_layerBridge; |
| 148 | 148 |
| 149 // This constructor will place its success into the given out-variable | 149 // This constructor will place its success into the given out-variable |
| 150 // so that create() knows when it should return failure. | 150 // so that create() knows when it should return failure. |
| 151 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod e, bool& success); | 151 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod e, int acceleratedSampleCount, bool& success); |
|
Stephen White
2013/10/18 20:13:12
Ubernit: this is called acceleratedSampleCount her
bsalomon
2013/10/21 13:48:47
nope, changed the cpp to match the header.
| |
| 152 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b ool hasAlpha, bool& success); | 152 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b ool hasAlpha, bool& success); |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double * quality); | 155 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double * quality); |
| 156 | 156 |
| 157 } // namespace WebCore | 157 } // namespace WebCore |
| 158 | 158 |
| 159 #endif // ImageBuffer_h | 159 #endif // ImageBuffer_h |
| OLD | NEW |