Changeset 206742 in webkit
- Timestamp:
- Oct 3, 2016 1:22:57 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206740 r206742 1 2016-10-03 Brent Fulgham <bfulgham@apple.com> 2 3 [Win][Direct2D] Add D2D Bitmap Image handling code 4 https://bugs.webkit.org/show_bug.cgi?id=162761 5 6 Reviewed by Dean Jackson. 7 8 This patch lands a set of new files that implement 9 Image and BitmapImage features on Windows using 10 Direct2D. 11 12 The desired ID2D1RenderTarget handle is needed by the 13 image decoder so that it can load the resulting bitmap 14 into the GPU. 15 16 No new tests until complete backend lands. 17 18 * platform/graphics/BitmapImage.cpp: 19 (WebCore::BitmapImage::draw): Tell the Direct2D image decoder 20 which render target to use. 21 * platform/graphics/BitmapImage.h: 22 * platform/graphics/ImageBuffer.cpp: 23 * platform/graphics/ImageBuffer.h: 24 * platform/graphics/ImageBufferData.h: 25 * platform/graphics/ImageFrameCache.cpp: 26 (WebCore::ImageFrameCache::setRenderTarget): Added. 27 * platform/graphics/ImageFrameCache.h: 28 (WebCore::ImageFrameCache::decoder): Added. 29 * platform/graphics/ImageSource.cpp: 30 * platform/graphics/ImageSource.h: 31 (WebCore::ImageSource::setRenderTarget): 32 * platform/graphics/win/ImageBufferDataDirect2D.cpp: Added. 33 * platform/graphics/win/ImageBufferDataDirect2D.h: Added. 34 * platform/graphics/win/ImageBufferDirect2D.cpp: Added. 35 * platform/graphics/win/ImageCGWin.cpp: 36 * platform/graphics/win/ImageDecoderDirect2D.cpp: Added. 37 * platform/graphics/win/ImageDecoderDirect2D.h: Added. 38 * platform/graphics/win/ImageDirect2D.cpp: Added. 39 * platform/graphics/win/NativeImageDirect2D.cpp: Added. 40 1 41 2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 42 -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r206631 r206742 142 142 return; 143 143 144 #if USE(DIRECT2D) 145 setRenderTarget(context); 146 #endif 147 144 148 #if PLATFORM(IOS) 145 149 startAnimation(DoNotCatchUp); -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r206720 r206742 123 123 Vector<NativeImagePtr> framesNativeImages() override; 124 124 #endif 125 #if USE(DIRECT2D) 126 void setRenderTarget(GraphicsContext&); 127 #endif 125 128 126 129 protected: -
trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp
r202927 r206742 82 82 } 83 83 84 #if ! USE(CG)84 #if !(USE(CG) || USE(DIRECT2D)) 85 85 FloatSize ImageBuffer::sizeForDestinationSize(FloatSize size) const 86 86 { -
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
r206631 r206742 40 40 #include <wtf/RefPtr.h> 41 41 #include <wtf/Vector.h> 42 43 #if PLATFORM(WIN) 44 interface ID2D1RenderTarget; 45 #endif 42 46 43 47 namespace WebCore { … … 150 154 static RetainPtr<CGImageRef> sinkIntoNativeImage(std::unique_ptr<ImageBuffer>); 151 155 void flushContext() const; 156 #elif USE(DIRECT2D) 157 void flushContext() const; 152 158 #endif 153 159 … … 176 182 #if USE(CG) 177 183 ImageBuffer(const FloatSize&, float resolutionScale, CGColorSpaceRef, RenderingMode, bool& success); 184 #elif USE(DIRECT2D) 185 ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, ID2D1RenderTarget*, bool& success); 178 186 #endif 179 187 }; -
trunk/Source/WebCore/platform/graphics/ImageBufferData.h
r173949 r206742 26 26 #if USE(CG) 27 27 #include "ImageBufferDataCG.h" 28 #elif USE(DIRECT2D) 29 #include "ImageBufferDataDirect2D.h" 28 30 #elif USE(CAIRO) 29 31 #include "ImageBufferDataCairo.h" -
trunk/Source/WebCore/platform/graphics/ImageFrameCache.cpp
r206635 r206742 32 32 #if USE(CG) 33 33 #include "ImageDecoderCG.h" 34 #elif USE(DIRECT2D) 35 #include "GraphicsContext.h" 36 #include "ImageDecoderDirect2D.h" 37 #include <WinCodec.h> 34 38 #else 35 39 #include "ImageDecoder.h" … … 375 379 } 376 380 377 } 381 #if USE(DIRECT2D) 382 void ImageFrameCache::setRenderTarget(GraphicsContext& context) 383 { 384 if (m_decoder) 385 m_decoder->setRenderTarget(context.platformContext()); 386 } 387 #endif 388 389 } -
trunk/Source/WebCore/platform/graphics/ImageFrameCache.h
r206635 r206742 34 34 namespace WebCore { 35 35 36 class GraphicsContext; 36 37 class Image; 37 38 class ImageDecoder; … … 44 45 45 46 void setDecoder(ImageDecoder* decoder) { m_decoder = decoder; } 47 ImageDecoder* decoder() const { return m_decoder; } 48 46 49 unsigned decodedSize() const { return m_decodedSize; } 47 50 void destroyDecodedData(bool destroyAll = true, size_t count = 0); … … 79 82 ImageOrientation frameOrientationAtIndex(size_t); 80 83 NativeImagePtr frameImageAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default); 84 85 #if USE(DIRECT2D) 86 void setRenderTarget(GraphicsContext&); 87 #endif 81 88 82 89 private: -
trunk/Source/WebCore/platform/graphics/ImageSource.cpp
r206526 r206742 32 32 #if USE(CG) 33 33 #include "ImageDecoderCG.h" 34 #elif USE(DIRECT2D) 35 #include "ImageDecoderDirect2D.h" 36 #include <WinCodec.h> 34 37 #else 35 38 #include "ImageDecoder.h" -
trunk/Source/WebCore/platform/graphics/ImageSource.h
r206481 r206742 39 39 namespace WebCore { 40 40 41 class GraphicsContext; 41 42 class ImageDecoder; 42 43 class ImageOrientation; … … 96 97 NativeImagePtr createFrameImageAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default); 97 98 99 #if USE(DIRECT2D) 100 void setRenderTarget(GraphicsContext& context) { m_frameCache.setRenderTarget(context); } 101 #endif 102 98 103 private: 99 104 void clearFrameBufferCache(size_t); -
trunk/Source/WebCore/platform/graphics/NativeImage.h
r206156 r206742 40 40 #endif 41 41 42 #if USE(DIRECT2D) 43 #include "COMPtr.h" 44 #include <d2d1.h> 45 #endif 46 42 47 namespace WebCore { 43 48 … … 49 54 #if USE(CG) 50 55 typedef RetainPtr<CGImageRef> NativeImagePtr; 56 #elif USE(DIRECT2D) 57 typedef COMPtr<ID2D1Bitmap> NativeImagePtr; 51 58 #elif USE(CAIRO) 52 59 typedef RefPtr<cairo_surface_t> NativeImagePtr; -
trunk/Source/WebCore/platform/graphics/win/ImageCGWin.cpp
r198655 r206742 26 26 #include "config.h" 27 27 #include "Image.h" 28 29 #if USE(CG) 28 30 29 31 #include "BitmapImage.h" … … 107 109 108 110 } // namespace WebCore 111 112 #endif
Note: See TracChangeset
for help on using the changeset viewer.