Changeset 117190 in webkit
- Timestamp:
- May 15, 2012 4:58:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117187 r117190 1 2012-05-15 James Robinson <jamesr@chromium.org> 2 3 [chromium] Chromium port never sets USE(CG) so code behind it is dead 4 https://bugs.webkit.org/show_bug.cgi?id=86537 5 6 Reviewed by Adrienne Walker. 7 8 Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards. 9 10 * platform/chromium/DragImageRef.h: 11 (WebCore): 12 * platform/chromium/MIMETypeRegistryChromium.cpp: 13 (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding): 14 * platform/chromium/ScrollbarThemeChromiumMac.mm: 15 (WebCore::ScrollbarThemeChromiumMac::paint): 16 * platform/chromium/ThemeChromiumMac.mm: 17 (WebCore::paintStepper): 18 * platform/graphics/chromium/PlatformImage.cpp: 19 (WebCore::PlatformImage::updateFromImage): 20 1 21 2012-05-15 Keyar Hood <keyar@chromium.org> 2 22 -
trunk/Source/WebCore/platform/chromium/DragImageRef.h
r95901 r117190 30 30 #define DragImageRef_h 31 31 32 #if USE(CG)33 typedef struct CGImage* CGImageRef;34 #else35 32 class SkBitmap; 36 #endif37 33 38 34 namespace WebCore { 39 35 40 #if USE(CG)41 typedef CGImageRef DragImageRef;42 #else43 36 typedef SkBitmap* DragImageRef; 44 #endif45 37 46 38 } // namespace WebCore -
trunk/Source/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp
r114641 r117190 105 105 if (mimeType == "image/jpeg" || mimeType == "image/png") 106 106 return true; 107 #if USE(WEBP) && USE(SKIA)107 #if USE(WEBP) 108 108 if (mimeType == "image/webp") 109 109 return true; -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
r114088 r117190 33 33 #include "LocalCurrentGraphicsContext.h" 34 34 #include "NSScrollerImpDetails.h" 35 #include "PlatformContextSkia.h" 35 36 #include "PlatformSupport.h" 36 37 #include "ScrollAnimatorMac.h" 37 38 #include "ScrollView.h" 39 #include "skia/ext/skia_utils_mac.h" 38 40 #include <Carbon/Carbon.h> 39 40 #if USE(SKIA)41 #include "PlatformContextSkia.h"42 #include "skia/ext/skia_utils_mac.h"43 #endif44 41 45 42 namespace WebCore { … … 122 119 } 123 120 124 #if !USE(SKIA)125 setIsCurrentlyDrawingIntoLayer(context->isCALayerContext());126 #else127 121 setIsCurrentlyDrawingIntoLayer(false); 128 #endif129 122 130 123 CGFloat oldKnobAlpha = 0; … … 202 195 trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart()); 203 196 204 #if USE(SKIA)205 197 SkCanvas* canvas = context->platformContext()->canvas(); 206 198 CGAffineTransform currentCTM = gfx::SkMatrixToCGAffineTransform(canvas->getTotalMatrix()); 207 #else208 CGAffineTransform currentCTM = CGContextGetCTM(context->platformContext());209 #endif210 199 211 200 // The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation. … … 228 217 229 218 // Draw thumbless. 230 #if USE(SKIA)231 219 gfx::SkiaBitLocker bitLocker(drawingContext->platformContext()->canvas()); 232 220 CGContextRef cgContext = bitLocker.cgContext(); 233 #else234 CGContextRef cgContext = drawingContext->platformContext();235 #endif236 221 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); 237 222 -
trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm
r113532 r117190 34 34 #import "WebCoreSystemInterface.h" 35 35 #import <Carbon/Carbon.h> 36 #include <wtf/StdLibExtras.h>37 36 #import <objc/runtime.h> 38 39 #if USE(SKIA)40 37 #include "PlatformContextSkia.h" 41 38 #include "skia/ext/skia_utils_mac.h" 42 # endif39 #include <wtf/StdLibExtras.h> 43 40 44 41 using namespace std; … … 642 639 backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1; 643 640 } 644 #if USE(SKIA)645 641 gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas()); 646 642 CGContextRef cgContext = bitLocker.cgContext(); 647 #else648 CGContextRef cgContext = context->platformContext();649 #endif650 643 HIThemeDrawButton(&backgroundBounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0); 651 644 context->restore(); -
trunk/Source/WebCore/platform/graphics/chromium/PlatformImage.cpp
r95901 r117190 25 25 26 26 #include "config.h" 27 28 27 #include "PlatformImage.h" 29 28 30 #if USE(SKIA)31 29 #include "NativeImageSkia.h" 32 30 #include "PlatformContextSkia.h" 33 #elif USE(CG)34 #include <CoreGraphics/CGBitmapContext.h>35 #include <CoreGraphics/CGContext.h>36 #include <CoreGraphics/CGImage.h>37 #include <wtf/RetainPtr.h>38 #else39 #error "Need to implement for your platform"40 #endif41 31 42 32 namespace WebCore { … … 48 38 void PlatformImage::updateFromImage(NativeImagePtr nativeImage) 49 39 { 50 #if USE(SKIA)51 40 // The layer contains an Image. 52 41 NativeImageSkia* skiaImage = static_cast<NativeImageSkia*>(nativeImage); … … 55 44 56 45 IntSize bitmapSize(skiaBitmap.width(), skiaBitmap.height()); 57 #elif USE(CG)58 // NativeImagePtr is a CGImageRef on Mac OS X.59 int width = CGImageGetWidth(nativeImage);60 int height = CGImageGetHeight(nativeImage);61 IntSize bitmapSize(width, height);62 #endif63 46 64 47 size_t bufferSize = bitmapSize.width() * bitmapSize.height() * 4; … … 69 52 } 70 53 71 #if USE(SKIA)72 54 SkAutoLockPixels lock(skiaBitmap); 73 55 // FIXME: do we need to support more image configurations? 74 56 ASSERT(skiaBitmap.config()== SkBitmap::kARGB_8888_Config); 75 57 skiaBitmap.copyPixelsTo(m_pixelData.get(), bufferSize); 76 #elif USE(CG)77 // FIXME: we should get rid of this temporary copy where possible.78 int tempRowBytes = width * 4;79 // Note we do not zero this vector since we are going to80 // completely overwrite its contents with the image below.81 // Try to reuse the color space from the image to preserve its colors.82 // Some images use a color space (such as indexed) unsupported by the bitmap context.83 RetainPtr<CGColorSpaceRef> colorSpaceReleaser;84 CGColorSpaceRef colorSpace = CGImageGetColorSpace(nativeImage);85 CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace);86 switch (colorSpaceModel) {87 case kCGColorSpaceModelMonochrome:88 case kCGColorSpaceModelRGB:89 case kCGColorSpaceModelCMYK:90 case kCGColorSpaceModelLab:91 case kCGColorSpaceModelDeviceN:92 break;93 default:94 colorSpaceReleaser.adoptCF(CGColorSpaceCreateDeviceRGB());95 colorSpace = colorSpaceReleaser.get();96 break;97 }98 RetainPtr<CGContextRef> tempContext(AdoptCF, CGBitmapContextCreate(m_pixelData.get(),99 width, height, 8, tempRowBytes,100 colorSpace,101 kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));102 CGContextSetBlendMode(tempContext.get(), kCGBlendModeCopy);103 CGContextDrawImage(tempContext.get(),104 CGRectMake(0, 0, static_cast<CGFloat>(width), static_cast<CGFloat>(height)),105 nativeImage);106 #else107 #error "Need to implement for your platform."108 #endif109 58 } 110 59 -
trunk/Source/WebKit/chromium/ChangeLog
r117177 r117190 1 2012-05-15 James Robinson <jamesr@chromium.org> 2 3 [chromium] Chromium port never sets USE(CG) so code behind it is dead 4 https://bugs.webkit.org/show_bug.cgi?id=86537 5 6 Reviewed by Adrienne Walker. 7 8 Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards. 9 10 * src/GraphicsContext3DChromium.cpp: 11 (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): 12 (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate): 13 (WebCore::GraphicsContext3DPrivate::grContext): 14 (WebCore::GraphicsContext3DPrivate::paintFramebufferToCanvas): 15 (WebCore::GraphicsContext3D::grContext): 16 * src/GraphicsContext3DPrivate.h: 17 (GraphicsContext3DPrivate): 18 * src/PlatformSupport.cpp: 19 * src/WebViewImpl.cpp: 20 (WebKit::WebViewImpl::doPixelReadbackToCanvas): 21 1 22 2012-05-15 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r117166 r117190 41 41 #include "DrawingBuffer.h" 42 42 #include "Extensions3DChromium.h" 43 #include "GrContext.h" 44 #include "GrGLInterface.h" 43 45 #include "GraphicsContext3DPrivate.h" 44 46 #include "HTMLCanvasElement.h" … … 53 55 #include <wtf/text/CString.h> 54 56 55 #if USE(CG)56 #include "GraphicsContext.h"57 #include "WebGLRenderingContext.h"58 #include <CoreGraphics/CGContext.h>59 #include <CoreGraphics/CGImage.h>60 #endif61 62 #if USE(SKIA)63 #include "GrContext.h"64 #include "GrGLInterface.h"65 #endif66 57 67 58 namespace { … … 98 89 , m_preserveDrawingBuffer(preserveDrawingBuffer) 99 90 , m_resourceSafety(ResourceSafetyUnknown) 100 #if USE(SKIA)101 91 , m_grContext(0) 102 #elif USE(CG)103 , m_renderOutputSize(0)104 #else105 #error Must port to your platform106 #endif107 92 { 108 93 } … … 110 95 GraphicsContext3DPrivate::~GraphicsContext3DPrivate() 111 96 { 112 #if USE(SKIA)113 97 if (m_grContext) { 114 98 m_grContext->contextDestroyed(); 115 99 GrSafeUnref(m_grContext); 116 100 } 117 #endif118 101 } 119 102 … … 164 147 } 165 148 166 #if USE(SKIA)167 149 class GrMemoryAllocationChangedCallback : public Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM { 168 150 public: … … 203 185 return m_grContext; 204 186 } 205 #endif206 187 207 188 void GraphicsContext3DPrivate::prepareTexture() … … 229 210 unsigned char* pixels = 0; 230 211 size_t bufferSize = 4 * width * height; 231 #if USE(SKIA) 212 232 213 const SkBitmap* canvasBitmap = imageBuffer->context()->platformContext()->bitmap(); 233 214 const SkBitmap* readbackBitmap = 0; … … 255 236 SkAutoLockPixels bitmapLock(*readbackBitmap); 256 237 pixels = static_cast<unsigned char*>(readbackBitmap->getPixels()); 257 #elif USE(CG)258 if (!m_renderOutput || m_renderOutputSize != bufferSize) {259 m_renderOutput = adoptArrayPtr(new unsigned char[bufferSize]);260 m_renderOutputSize = bufferSize;261 }262 263 pixels = m_renderOutput.get();264 #else265 #error Must port to your platform266 #endif267 238 268 239 m_impl->readBackFramebuffer(pixels, 4 * width * height, framebuffer, width, height); … … 276 247 } 277 248 278 #if USE(SKIA)279 249 readbackBitmap->notifyPixelsChanged(); 280 250 if (m_resizingBitmap.readyToDraw()) { … … 285 255 canvas.drawBitmapRect(m_resizingBitmap, 0, dst); 286 256 } 287 #elif USE(CG)288 GraphicsContext3D::paintToCanvas(pixels, width, height, imageBuffer->width(), imageBuffer->height(), imageBuffer->context()->platformContext());289 #else290 #error Must port to your platform291 #endif292 257 } 293 258 … … 1058 1023 } 1059 1024 1060 #if USE(SKIA)1061 1025 GrContext* GraphicsContext3D::grContext() 1062 1026 { 1063 1027 return m_private->grContext(); 1064 1028 } 1065 #endif1066 1029 1067 1030 void GraphicsContext3D::prepareTexture() -
trunk/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h
r117110 r117190 29 29 #include "Extensions3DChromium.h" 30 30 #include "GraphicsContext3D.h" 31 #include "SkBitmap.h" 31 32 #include <wtf/HashSet.h> 32 33 #include <wtf/OwnArrayPtr.h> 33 34 #include <wtf/OwnPtr.h> 34 #if USE(SKIA) 35 #include "SkBitmap.h" 36 #endif 37 38 #if USE(SKIA) 35 39 36 class GrContext; 40 #endif41 37 42 38 namespace WebKit { … … 69 65 PlatformGraphicsContext3D platformGraphicsContext3D() const; 70 66 Platform3DObject platformTexture() const; 71 #if USE(SKIA)72 67 GrContext* grContext(); 73 #endif74 68 75 69 bool makeContextCurrent(); … … 325 319 GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer); 326 320 321 void initializeExtensions(); 322 327 323 OwnPtr<WebKit::WebGraphicsContext3D> m_impl; 328 324 OwnPtr<Extensions3DChromium> m_extensions; … … 344 340 ResourceSafety m_resourceSafety; 345 341 346 #if USE(SKIA)347 342 // If the width and height of the Canvas's backing store don't 348 343 // match those that we were given in the most recent call to … … 353 348 354 349 GrContext* m_grContext; 355 #endif356 357 #if USE(CG)358 OwnArrayPtr<unsigned char> m_renderOutput;359 size_t m_renderOutputSize;360 #endif361 362 void initializeExtensions();363 350 }; 364 351 -
trunk/Source/WebKit/chromium/src/PlatformSupport.cpp
r116840 r117190 61 61 #include "platform/WebURL.h" 62 62 #include "platform/WebVector.h" 63 64 #if USE(CG)65 #include <CoreGraphics/CGContext.h>66 #endif67 63 68 64 #if OS(WINDOWS) -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r117170 r117190 166 166 #endif 167 167 168 #if USE(CG)169 #include <CoreGraphics/CGBitmapContext.h>170 #include <CoreGraphics/CGContext.h>171 #endif172 173 168 #if OS(WINDOWS) 174 169 #include "RenderThemeChromiumWin.h" … … 1485 1480 { 1486 1481 ASSERT(!m_layerTreeView.isNull()); 1487 #if USE(SKIA) 1482 1488 1483 PlatformContextSkia context(canvas); 1489 1484 … … 1491 1486 GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); 1492 1487 int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); 1493 #elif USE(CG) 1494 GraphicsContext gc(canvas); 1495 int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas)); 1496 #else 1497 notImplemented(); 1498 #endif 1488 1499 1489 // Compute rect to sample from inverted GPU buffer. 1500 1490 IntRect invertRect(rect.x(), bitmapHeight - rect.maxY(), rect.width(), rect.height()); -
trunk/Tools/ChangeLog
r117186 r117190 1 2012-05-15 James Robinson <jamesr@chromium.org> 2 3 [chromium] Chromium port never sets USE(CG) so code behind it is dead 4 https://bugs.webkit.org/show_bug.cgi?id=86537 5 6 Reviewed by Adrienne Walker. 7 8 Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards. 9 10 * DumpRenderTree/chromium/WebViewHost.cpp: 11 (WebViewHost::paintRect): 12 1 13 2012-05-15 James Robinson <jamesr@chromium.org> 2 14 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r117186 r117190 1736 1736 ASSERT(canvas()); 1737 1737 m_isPainting = true; 1738 #if USE(CG)1739 webWidget()->paint(skia::BeginPlatformPaint(canvas()), rect);1740 skia::EndPlatformPaint(canvas());1741 #else1742 1738 webWidget()->paint(canvas(), rect); 1743 #endif1744 1739 m_isPainting = false; 1745 1740 }
Note: See TracChangeset
for help on using the changeset viewer.