Diff
Modified: trunk/Source/WebCore/ChangeLog (117189 => 117190)
--- trunk/Source/WebCore/ChangeLog 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebCore/ChangeLog 2012-05-15 23:58:55 UTC (rev 117190)
@@ -1,3 +1,23 @@
+2012-05-15 James Robinson <[email protected]>
+
+ [chromium] Chromium port never sets USE(CG) so code behind it is dead
+ https://bugs.webkit.org/show_bug.cgi?id=86537
+
+ Reviewed by Adrienne Walker.
+
+ Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards.
+
+ * platform/chromium/DragImageRef.h:
+ (WebCore):
+ * platform/chromium/MIMETypeRegistryChromium.cpp:
+ (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
+ * platform/chromium/ScrollbarThemeChromiumMac.mm:
+ (WebCore::ScrollbarThemeChromiumMac::paint):
+ * platform/chromium/ThemeChromiumMac.mm:
+ (WebCore::paintStepper):
+ * platform/graphics/chromium/PlatformImage.cpp:
+ (WebCore::PlatformImage::updateFromImage):
+
2012-05-15 Keyar Hood <[email protected]>
Skia does not respect a specified InterpolationQuality
Modified: trunk/Source/WebCore/platform/chromium/DragImageRef.h (117189 => 117190)
--- trunk/Source/WebCore/platform/chromium/DragImageRef.h 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebCore/platform/chromium/DragImageRef.h 2012-05-15 23:58:55 UTC (rev 117190)
@@ -29,19 +29,11 @@
#ifndef DragImageRef_h
#define DragImageRef_h
-#if USE(CG)
-typedef struct CGImage* CGImageRef;
-#else
class SkBitmap;
-#endif
namespace WebCore {
-#if USE(CG)
-typedef CGImageRef DragImageRef;
-#else
typedef SkBitmap* DragImageRef;
-#endif
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp (117189 => 117190)
--- trunk/Source/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp 2012-05-15 23:58:55 UTC (rev 117190)
@@ -104,7 +104,7 @@
{
if (mimeType == "image/jpeg" || mimeType == "image/png")
return true;
-#if USE(WEBP) && USE(SKIA)
+#if USE(WEBP)
if (mimeType == "image/webp")
return true;
#endif
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm (117189 => 117190)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2012-05-15 23:58:55 UTC (rev 117190)
@@ -32,16 +32,13 @@
#include "ImageBuffer.h"
#include "LocalCurrentGraphicsContext.h"
#include "NSScrollerImpDetails.h"
+#include "PlatformContextSkia.h"
#include "PlatformSupport.h"
#include "ScrollAnimatorMac.h"
#include "ScrollView.h"
+#include "skia/ext/skia_utils_mac.h"
#include <Carbon/Carbon.h>
-#if USE(SKIA)
-#include "PlatformContextSkia.h"
-#include "skia/ext/skia_utils_mac.h"
-#endif
-
namespace WebCore {
ScrollbarTheme* ScrollbarTheme::nativeTheme()
@@ -121,11 +118,7 @@
value = 0;
}
-#if !USE(SKIA)
- setIsCurrentlyDrawingIntoLayer(context->isCALayerContext());
-#else
setIsCurrentlyDrawingIntoLayer(false);
-#endif
CGFloat oldKnobAlpha = 0;
CGFloat oldTrackAlpha = 0;
@@ -201,12 +194,8 @@
trackInfo.enableState = kThemeTrackNothingToScroll;
trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart());
-#if USE(SKIA)
SkCanvas* canvas = context->platformContext()->canvas();
CGAffineTransform currentCTM = gfx::SkMatrixToCGAffineTransform(canvas->getTotalMatrix());
-#else
- CGAffineTransform currentCTM = CGContextGetCTM(context->platformContext());
-#endif
// The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation.
bool canDrawDirectly = currentCTM.a == 1.0f && currentCTM.b == 0.0f && currentCTM.c == 0.0f && (currentCTM.d == 1.0f || currentCTM.d == -1.0f);
@@ -227,12 +216,8 @@
}
// Draw thumbless.
-#if USE(SKIA)
gfx::SkiaBitLocker bitLocker(drawingContext->platformContext()->canvas());
CGContextRef cgContext = bitLocker.cgContext();
-#else
- CGContextRef cgContext = drawingContext->platformContext();
-#endif
HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
IntRect tickmarkTrackRect = trackRect(scrollbar, false);
Modified: trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm (117189 => 117190)
--- trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm 2012-05-15 23:58:55 UTC (rev 117190)
@@ -33,13 +33,10 @@
#import "ScrollView.h"
#import "WebCoreSystemInterface.h"
#import <Carbon/Carbon.h>
-#include <wtf/StdLibExtras.h>
#import <objc/runtime.h>
-
-#if USE(SKIA)
#include "PlatformContextSkia.h"
#include "skia/ext/skia_utils_mac.h"
-#endif
+#include <wtf/StdLibExtras.h>
using namespace std;
@@ -641,12 +638,8 @@
int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
}
-#if USE(SKIA)
gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas());
CGContextRef cgContext = bitLocker.cgContext();
-#else
- CGContextRef cgContext = context->platformContext();
-#endif
HIThemeDrawButton(&backgroundBounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0);
context->restore();
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/PlatformImage.cpp (117189 => 117190)
--- trunk/Source/WebCore/platform/graphics/chromium/PlatformImage.cpp 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebCore/platform/graphics/chromium/PlatformImage.cpp 2012-05-15 23:58:55 UTC (rev 117190)
@@ -24,20 +24,10 @@
*/
#include "config.h"
-
#include "PlatformImage.h"
-#if USE(SKIA)
#include "NativeImageSkia.h"
#include "PlatformContextSkia.h"
-#elif USE(CG)
-#include <CoreGraphics/CGBitmapContext.h>
-#include <CoreGraphics/CGContext.h>
-#include <CoreGraphics/CGImage.h>
-#include <wtf/RetainPtr.h>
-#else
-#error "Need to implement for your platform"
-#endif
namespace WebCore {
@@ -47,19 +37,12 @@
void PlatformImage::updateFromImage(NativeImagePtr nativeImage)
{
-#if USE(SKIA)
// The layer contains an Image.
NativeImageSkia* skiaImage = static_cast<NativeImageSkia*>(nativeImage);
ASSERT(skiaImage);
const SkBitmap& skiaBitmap = skiaImage->bitmap();
IntSize bitmapSize(skiaBitmap.width(), skiaBitmap.height());
-#elif USE(CG)
- // NativeImagePtr is a CGImageRef on Mac OS X.
- int width = CGImageGetWidth(nativeImage);
- int height = CGImageGetHeight(nativeImage);
- IntSize bitmapSize(width, height);
-#endif
size_t bufferSize = bitmapSize.width() * bitmapSize.height() * 4;
if (m_size != bitmapSize) {
@@ -68,44 +51,10 @@
m_size = bitmapSize;
}
-#if USE(SKIA)
SkAutoLockPixels lock(skiaBitmap);
// FIXME: do we need to support more image configurations?
ASSERT(skiaBitmap.config()== SkBitmap::kARGB_8888_Config);
skiaBitmap.copyPixelsTo(m_pixelData.get(), bufferSize);
-#elif USE(CG)
- // FIXME: we should get rid of this temporary copy where possible.
- int tempRowBytes = width * 4;
- // Note we do not zero this vector since we are going to
- // completely overwrite its contents with the image below.
- // Try to reuse the color space from the image to preserve its colors.
- // Some images use a color space (such as indexed) unsupported by the bitmap context.
- RetainPtr<CGColorSpaceRef> colorSpaceReleaser;
- CGColorSpaceRef colorSpace = CGImageGetColorSpace(nativeImage);
- CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace);
- switch (colorSpaceModel) {
- case kCGColorSpaceModelMonochrome:
- case kCGColorSpaceModelRGB:
- case kCGColorSpaceModelCMYK:
- case kCGColorSpaceModelLab:
- case kCGColorSpaceModelDeviceN:
- break;
- default:
- colorSpaceReleaser.adoptCF(CGColorSpaceCreateDeviceRGB());
- colorSpace = colorSpaceReleaser.get();
- break;
- }
- RetainPtr<CGContextRef> tempContext(AdoptCF, CGBitmapContextCreate(m_pixelData.get(),
- width, height, 8, tempRowBytes,
- colorSpace,
- kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
- CGContextSetBlendMode(tempContext.get(), kCGBlendModeCopy);
- CGContextDrawImage(tempContext.get(),
- CGRectMake(0, 0, static_cast<CGFloat>(width), static_cast<CGFloat>(height)),
- nativeImage);
-#else
-#error "Need to implement for your platform."
-#endif
}
} // namespace WebCore
Modified: trunk/Source/WebKit/chromium/ChangeLog (117189 => 117190)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-15 23:58:55 UTC (rev 117190)
@@ -1,3 +1,24 @@
+2012-05-15 James Robinson <[email protected]>
+
+ [chromium] Chromium port never sets USE(CG) so code behind it is dead
+ https://bugs.webkit.org/show_bug.cgi?id=86537
+
+ Reviewed by Adrienne Walker.
+
+ Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards.
+
+ * src/GraphicsContext3DChromium.cpp:
+ (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
+ (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
+ (WebCore::GraphicsContext3DPrivate::grContext):
+ (WebCore::GraphicsContext3DPrivate::paintFramebufferToCanvas):
+ (WebCore::GraphicsContext3D::grContext):
+ * src/GraphicsContext3DPrivate.h:
+ (GraphicsContext3DPrivate):
+ * src/PlatformSupport.cpp:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::doPixelReadbackToCanvas):
+
2012-05-15 Anders Carlsson <[email protected]>
Set the new PlatformWheelEvent member variables to sane defaults
Modified: trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp (117189 => 117190)
--- trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp 2012-05-15 23:58:55 UTC (rev 117190)
@@ -40,6 +40,8 @@
#include "ChromeClientImpl.h"
#include "DrawingBuffer.h"
#include "Extensions3DChromium.h"
+#include "GrContext.h"
+#include "GrGLInterface.h"
#include "GraphicsContext3DPrivate.h"
#include "HTMLCanvasElement.h"
#include "HTMLImageElement.h"
@@ -52,18 +54,7 @@
#include <wtf/FastMalloc.h>
#include <wtf/text/CString.h>
-#if USE(CG)
-#include "GraphicsContext.h"
-#include "WebGLRenderingContext.h"
-#include <CoreGraphics/CGContext.h>
-#include <CoreGraphics/CGImage.h>
-#endif
-#if USE(SKIA)
-#include "GrContext.h"
-#include "GrGLInterface.h"
-#endif
-
namespace {
// The limit of the number of textures we hold in the GrContext's bitmap->texture cache.
@@ -97,24 +88,16 @@
, m_layerComposited(false)
, m_preserveDrawingBuffer(preserveDrawingBuffer)
, m_resourceSafety(ResourceSafetyUnknown)
-#if USE(SKIA)
, m_grContext(0)
-#elif USE(CG)
- , m_renderOutputSize(0)
-#else
-#error Must port to your platform
-#endif
{
}
GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
{
-#if USE(SKIA)
if (m_grContext) {
m_grContext->contextDestroyed();
GrSafeUnref(m_grContext);
}
-#endif
}
PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, GraphicsContext3D::RenderStyle renderStyle, bool preserveDrawingBuffer)
@@ -163,7 +146,6 @@
return m_impl->getPlatformTextureId();
}
-#if USE(SKIA)
class GrMemoryAllocationChangedCallback : public Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM {
public:
GrMemoryAllocationChangedCallback(GraphicsContext3DPrivate* context)
@@ -202,7 +184,6 @@
}
return m_grContext;
}
-#endif
void GraphicsContext3DPrivate::prepareTexture()
{
@@ -228,7 +209,7 @@
{
unsigned char* pixels = 0;
size_t bufferSize = 4 * width * height;
-#if USE(SKIA)
+
const SkBitmap* canvasBitmap = imageBuffer->context()->platformContext()->bitmap();
const SkBitmap* readbackBitmap = 0;
ASSERT(canvasBitmap->config() == SkBitmap::kARGB_8888_Config);
@@ -254,17 +235,7 @@
// Read back the frame buffer.
SkAutoLockPixels bitmapLock(*readbackBitmap);
pixels = static_cast<unsigned char*>(readbackBitmap->getPixels());
-#elif USE(CG)
- if (!m_renderOutput || m_renderOutputSize != bufferSize) {
- m_renderOutput = adoptArrayPtr(new unsigned char[bufferSize]);
- m_renderOutputSize = bufferSize;
- }
- pixels = m_renderOutput.get();
-#else
-#error Must port to your platform
-#endif
-
m_impl->readBackFramebuffer(pixels, 4 * width * height, framebuffer, width, height);
if (premultiplyAlpha) {
@@ -275,7 +246,6 @@
}
}
-#if USE(SKIA)
readbackBitmap->notifyPixelsChanged();
if (m_resizingBitmap.readyToDraw()) {
// We need to draw the resizing bitmap into the canvas's backing store.
@@ -284,11 +254,6 @@
dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height()));
canvas.drawBitmapRect(m_resizingBitmap, 0, dst);
}
-#elif USE(CG)
- GraphicsContext3D::paintToCanvas(pixels, width, height, imageBuffer->width(), imageBuffer->height(), imageBuffer->context()->platformContext());
-#else
-#error Must port to your platform
-#endif
}
void GraphicsContext3DPrivate::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer* drawingBuffer)
@@ -1057,12 +1022,10 @@
return m_private->platformTexture();
}
-#if USE(SKIA)
GrContext* GraphicsContext3D::grContext()
{
return m_private->grContext();
}
-#endif
void GraphicsContext3D::prepareTexture()
{
Modified: trunk/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h (117189 => 117190)
--- trunk/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h 2012-05-15 23:58:55 UTC (rev 117190)
@@ -28,16 +28,12 @@
#include "Extensions3DChromium.h"
#include "GraphicsContext3D.h"
+#include "SkBitmap.h"
#include <wtf/HashSet.h>
#include <wtf/OwnArrayPtr.h>
#include <wtf/OwnPtr.h>
-#if USE(SKIA)
-#include "SkBitmap.h"
-#endif
-#if USE(SKIA)
class GrContext;
-#endif
namespace WebKit {
class WebGraphicsContext3D;
@@ -68,9 +64,7 @@
PlatformGraphicsContext3D platformGraphicsContext3D() const;
Platform3DObject platformTexture() const;
-#if USE(SKIA)
GrContext* grContext();
-#endif
bool makeContextCurrent();
@@ -324,6 +318,8 @@
private:
GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer);
+ void initializeExtensions();
+
OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
OwnPtr<Extensions3DChromium> m_extensions;
OwnPtr<GraphicsContextLostCallbackAdapter> m_contextLostCallbackAdapter;
@@ -343,7 +339,6 @@
};
ResourceSafety m_resourceSafety;
-#if USE(SKIA)
// If the width and height of the Canvas's backing store don't
// match those that we were given in the most recent call to
// reshape(), then we need an intermediate bitmap to read back the
@@ -352,14 +347,6 @@
SkBitmap m_resizingBitmap;
GrContext* m_grContext;
-#endif
-
-#if USE(CG)
- OwnArrayPtr<unsigned char> m_renderOutput;
- size_t m_renderOutputSize;
-#endif
-
- void initializeExtensions();
};
} // namespace WebCore
Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (117189 => 117190)
--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp 2012-05-15 23:58:55 UTC (rev 117190)
@@ -61,10 +61,6 @@
#include "platform/WebURL.h"
#include "platform/WebVector.h"
-#if USE(CG)
-#include <CoreGraphics/CGContext.h>
-#endif
-
#if OS(WINDOWS)
#include "platform/WebRect.h"
#include "platform/win/WebThemeEngine.h"
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (117189 => 117190)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-05-15 23:58:55 UTC (rev 117190)
@@ -165,11 +165,6 @@
#include "PlatformGestureEvent.h"
#endif
-#if USE(CG)
-#include <CoreGraphics/CGBitmapContext.h>
-#include <CoreGraphics/CGContext.h>
-#endif
-
#if OS(WINDOWS)
#include "RenderThemeChromiumWin.h"
#else
@@ -1484,18 +1479,13 @@
void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect)
{
ASSERT(!m_layerTreeView.isNull());
-#if USE(SKIA)
+
PlatformContextSkia context(canvas);
// PlatformGraphicsContext is actually a pointer to PlatformContextSkia
GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
int bitmapHeight = canvas->getDevice()->accessBitmap(false).height();
-#elif USE(CG)
- GraphicsContext gc(canvas);
- int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas));
-#else
- notImplemented();
-#endif
+
// Compute rect to sample from inverted GPU buffer.
IntRect invertRect(rect.x(), bitmapHeight - rect.maxY(), rect.width(), rect.height());
Modified: trunk/Tools/ChangeLog (117189 => 117190)
--- trunk/Tools/ChangeLog 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Tools/ChangeLog 2012-05-15 23:58:55 UTC (rev 117190)
@@ -1,5 +1,17 @@
2012-05-15 James Robinson <[email protected]>
+ [chromium] Chromium port never sets USE(CG) so code behind it is dead
+ https://bugs.webkit.org/show_bug.cgi?id=86537
+
+ Reviewed by Adrienne Walker.
+
+ Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::paintRect):
+
+2012-05-15 James Robinson <[email protected]>
+
[chromium] Remove WEBKIT_USING_(SKIA|CG) #defines
https://bugs.webkit.org/show_bug.cgi?id=86536
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (117189 => 117190)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-05-15 23:57:41 UTC (rev 117189)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-05-15 23:58:55 UTC (rev 117190)
@@ -1735,12 +1735,7 @@
ASSERT(!m_isPainting);
ASSERT(canvas());
m_isPainting = true;
-#if USE(CG)
- webWidget()->paint(skia::BeginPlatformPaint(canvas()), rect);
- skia::EndPlatformPaint(canvas());
-#else
webWidget()->paint(canvas(), rect);
-#endif
m_isPainting = false;
}