Diff
Modified: trunk/Source/WebCore/ChangeLog (112123 => 112124)
--- trunk/Source/WebCore/ChangeLog 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/ChangeLog 2012-03-26 17:43:05 UTC (rev 112124)
@@ -1,3 +1,63 @@
+2012-03-26 Filip Spacek <[email protected]>
+
+ [BlackBerry] Accelerated compositing updates
+ https://bugs.webkit.org/show_bug.cgi?id=82058
+
+ Reviewed by Rob Buis.
+
+ * platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
+ (WebCore::CanvasLayerWebKitThread::CanvasLayerWebKitThread):
+ (WebCore::CanvasLayerWebKitThread::~CanvasLayerWebKitThread):
+ (WebCore::CanvasLayerWebKitThread::setDevice):
+ (WebCore::CanvasLayerWebKitThread::updateTextureContentsIfNeeded):
+ * platform/graphics/blackberry/CanvasLayerWebKitThread.h:
+ (WebCore::CanvasLayerWebKitThread::create):
+ (CanvasLayerWebKitThread):
+ * platform/graphics/blackberry/InstrumentedPlatformCanvas.h:
+ (WebCore::InstrumentedPlatformCanvas::InstrumentedPlatformCanvas):
+ (WebCore::InstrumentedPlatformCanvas::save):
+ (WebCore::InstrumentedPlatformCanvas::saveLayer):
+ (WebCore::InstrumentedPlatformCanvas::restore):
+ (WebCore::InstrumentedPlatformCanvas::translate):
+ (WebCore::InstrumentedPlatformCanvas::scale):
+ (WebCore::InstrumentedPlatformCanvas::rotate):
+ (WebCore::InstrumentedPlatformCanvas::skew):
+ (WebCore::InstrumentedPlatformCanvas::concat):
+ (WebCore::InstrumentedPlatformCanvas::setMatrix):
+ (WebCore::InstrumentedPlatformCanvas::clipRect):
+ (WebCore::InstrumentedPlatformCanvas::clipPath):
+ (WebCore::InstrumentedPlatformCanvas::clipRegion):
+ (WebCore::InstrumentedPlatformCanvas::clear):
+ (WebCore::InstrumentedPlatformCanvas::drawPaint):
+ (WebCore::InstrumentedPlatformCanvas::drawPoints):
+ (WebCore::InstrumentedPlatformCanvas::drawRect):
+ (WebCore::InstrumentedPlatformCanvas::drawPath):
+ (WebCore::InstrumentedPlatformCanvas::drawBitmap):
+ (WebCore::InstrumentedPlatformCanvas::drawBitmapRect):
+ (WebCore::InstrumentedPlatformCanvas::drawBitmapMatrix):
+ (WebCore::InstrumentedPlatformCanvas::drawSprite):
+ (WebCore::InstrumentedPlatformCanvas::drawText):
+ (WebCore::InstrumentedPlatformCanvas::drawPosText):
+ (WebCore::InstrumentedPlatformCanvas::drawPosTextH):
+ (WebCore::InstrumentedPlatformCanvas::drawTextOnPath):
+ (WebCore::InstrumentedPlatformCanvas::drawPicture):
+ (WebCore::InstrumentedPlatformCanvas::drawVertices):
+ (WebCore::InstrumentedPlatformCanvas::drawData):
+ * platform/graphics/blackberry/LayerData.h:
+ (WebCore::LayerData::LayerData):
+ (WebCore::LayerData::needsTexture):
+ (LayerData):
+ * platform/graphics/blackberry/LayerTiler.cpp:
+ (WebCore::LayerTiler::updateTextureContentsIfNeeded):
+ * platform/graphics/blackberry/LayerWebKitThread.cpp:
+ (WebCore::LayerWebKitThread::paintContents):
+ (WebCore::LayerWebKitThread::setDrawable):
+ * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
+ (WebCore::loadBufferingImageData):
+ * platform/graphics/blackberry/skia/ImageBufferDataSkia.h: Renamed from Source/WebCore/platform/graphics/blackberry/skia/ImageBufferData.h.
+ (WebCore):
+ (ImageBufferData):
+
2012-03-26 Stephen Chenney <[email protected]>
Failure to invalidate text position attributes when DOM changes
Modified: trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp 2012-03-26 17:43:05 UTC (rev 112124)
@@ -19,36 +19,31 @@
#include "config.h"
#include "CanvasLayerWebKitThread.h"
-#if USE(ACCELERATED_COMPOSITING) && ENABLE(SKIA_GPU_CANVAS)
+#if USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
-#include "HTMLCanvasElement.h"
-#include "PlatformContextSkia.h"
-
-#include <BlackBerryPlatformGraphics.h>
+#include "SharedGraphicsContext3D.h"
#include <GLES2/gl2.h>
-#include <GrGLTexture.h>
#include <SkGpuDevice.h>
namespace WebCore {
-CanvasLayerWebKitThread::CanvasLayerWebKitThread(HTMLCanvasElement* canvas)
- : LayerWebKitThread(Layer, 0)
+CanvasLayerWebKitThread::CanvasLayerWebKitThread(SkGpuDevice* device)
+ : LayerWebKitThread(CanvasLayer, 0)
{
- setCanvas(canvas);
+ setDevice(device);
}
CanvasLayerWebKitThread::~CanvasLayerWebKitThread()
{
if (m_texID) {
- BlackBerry::Platform::Graphics::makeSharedResourceContextCurrent(BlackBerry::Platform::Graphics::GLES2);
+ SharedGraphicsContext3D::get()->makeContextCurrent();
glDeleteTextures(1, &m_texID);
}
}
-void CanvasLayerWebKitThread::setCanvas(HTMLCanvasElement* canvas)
+void CanvasLayerWebKitThread::setDevice(SkGpuDevice* device)
{
- m_canvas = canvas;
- setNeedsTexture(isDrawable() && canvas);
+ m_device = device;
setLayerProgramShader(LayerProgramShaderRGBA);
setNeedsDisplay();
}
@@ -61,22 +56,12 @@
void CanvasLayerWebKitThread::updateTextureContentsIfNeeded()
{
- if (!m_needsDisplay)
+ if (!m_needsDisplay || !m_device)
return;
m_needsDisplay = false;
+ m_device->makeRenderTargetCurrent();
- if (!m_canvas || !m_canvas->drawingContext())
- return;
-
- SkGpuDevice* gpuDevice = static_cast<SkGpuDevice*>(m_canvas->drawingContext()->platformContext()->canvas()->getDevice());
- gpuDevice->makeRenderTargetCurrent();
- // We know this is a GrGLTexture
- if (GrGLTexture* deviceTexture = (GrGLTexture*)gpuDevice->accessTexture()) {
- m_texWidth = deviceTexture->allocWidth();
- m_texHeight = deviceTexture->allocHeight();
- }
-
GLint previousTexture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &previousTexture);
@@ -87,18 +72,18 @@
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_canvas->width(), m_canvas->height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_device->width(), m_device->height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
createFrontBufferLock();
}
pthread_mutex_lock(m_frontBufferLock);
glBindTexture(GL_TEXTURE_2D, m_texID);
- glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, m_texWidth, m_texHeight, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, m_device->width(), m_device->height(), 0);
glBindTexture(GL_TEXTURE_2D, previousTexture);
pthread_mutex_unlock(m_frontBufferLock);
}
}
-#endif // USE(ACCELERATED_COMPOSITING) && ENABLE(SKIA_GPU_CANVAS)
+#endif // USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
Modified: trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h 2012-03-26 17:43:05 UTC (rev 112124)
@@ -19,24 +19,26 @@
#ifndef CanvasLayerWebKitThread_h
#define CanvasLayerWebKitThread_h
-#if USE(ACCELERATED_COMPOSITING) && ENABLE(SKIA_GPU_CANVAS)
+#if USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
#include "LayerWebKitThread.h"
+class SkGpuDevice;
+
namespace WebCore {
class HTMLCanvasElement;
class CanvasLayerWebKitThread : public LayerWebKitThread {
public:
- static PassRefPtr<CanvasLayerWebKitThread> create(HTMLCanvasElement* canvas)
+ static PassRefPtr<CanvasLayerWebKitThread> create(SkGpuDevice* device)
{
- return adoptRef(new CanvasLayerWebKitThread(canvas));
+ return adoptRef(new CanvasLayerWebKitThread(device));
}
virtual ~CanvasLayerWebKitThread();
- void setCanvas(HTMLCanvasElement*);
+ void setDevice(SkGpuDevice*);
virtual void setNeedsDisplay();
@@ -44,12 +46,13 @@
virtual void updateTextureContentsIfNeeded();
private:
- CanvasLayerWebKitThread(HTMLCanvasElement*);
+ CanvasLayerWebKitThread(SkGpuDevice*);
bool m_needsDisplay;
+ SkGpuDevice* m_device;
};
}
-#endif // USE(ACCELERATED_COMPOSITING) && ENABLE(SKIA_GPU_CANVAS)
+#endif // USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
#endif // CanvasLayerWebKitThread_h
Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp 2012-03-26 17:43:05 UTC (rev 112124)
@@ -187,15 +187,16 @@
canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, canvasWidth, canvasHeight);
canvasBitmap.allocPixels(0, 0);
- bool rc = canvasBitmap.copyPixelsFrom(static_cast<void*>(const_cast<unsigned char*>(tempPixels)), imageWidth * imageHeight * 4);
+ canvasBitmap.lockPixels();
+ memcpy(canvasBitmap.getPixels(), tempPixels, imageWidth * imageHeight * 4);
+ canvasBitmap.unlockPixels();
delete [] tempPixels;
FloatRect src(0, 0, canvasWidth, canvasHeight);
FloatRect dst(0, 0, imageWidth, imageHeight);
RefPtr<BitmapImageSingleFrameSkia> bitmapImage = BitmapImageSingleFrameSkia::create(canvasBitmap, false);
- if (rc)
- context->drawImage(bitmapImage.get(), ColorSpaceDeviceRGB, dst, src, CompositeCopy, false);
+ context->drawImage(bitmapImage.get(), ColorSpaceDeviceRGB, dst, src, CompositeCopy, false);
}
void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
Modified: trunk/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h 2012-03-26 17:43:05 UTC (rev 112124)
@@ -34,14 +34,14 @@
namespace WebCore {
-class InstrumentedPlatformCanvas : public skia::PlatformCanvas {
+class InstrumentedPlatformCanvas : public SkCanvas {
public:
- InstrumentedPlatformCanvas(int width, int height, bool is_opaque, SkDeviceFactory* factory)
- : skia::PlatformCanvas(width, height, is_opaque, factory)
- , m_size(width, height)
+ InstrumentedPlatformCanvas(int width, int height)
+ : m_size(width, height)
, m_isSolidColor(true)
, m_solidColor(0, 0, 0, 0)
{
+ setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, width, height))->unref();
}
virtual ~InstrumentedPlatformCanvas() { }
@@ -53,76 +53,76 @@
virtual int save(SaveFlags flags)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::save(flags);
+ return SkCanvas::save(flags);
}
virtual int saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- return skia::PlatformCanvas::saveLayer(bounds, paint, flags);
+ return SkCanvas::saveLayer(bounds, paint, flags);
}
virtual void restore()
{
WRAPCANVAS_LOG_ENTRY("");
- skia::PlatformCanvas::restore();
+ SkCanvas::restore();
}
virtual bool translate(SkScalar dx, SkScalar dy)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::translate(dx, dy);
+ return SkCanvas::translate(dx, dy);
}
virtual bool scale(SkScalar sx, SkScalar sy)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::scale(sx, sy);
+ return SkCanvas::scale(sx, sy);
}
virtual bool rotate(SkScalar degrees)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::rotate(degrees);
+ return SkCanvas::rotate(degrees);
}
virtual bool skew(SkScalar sx, SkScalar sy)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::skew(sx, sy);
+ return SkCanvas::skew(sx, sy);
}
virtual bool concat(const SkMatrix& matrix)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::concat(matrix);
+ return SkCanvas::concat(matrix);
}
virtual void setMatrix(const SkMatrix& matrix)
{
WRAPCANVAS_LOG_ENTRY("");
- skia::PlatformCanvas::setMatrix(matrix);
+ SkCanvas::setMatrix(matrix);
}
virtual bool clipRect(const SkRect& rect, SkRegion::Op op)
{
WRAPCANVAS_LOG_ENTRY("");
- return skia::PlatformCanvas::clipRect(rect, op);
+ return SkCanvas::clipRect(rect, op);
}
virtual bool clipPath(const SkPath& path, SkRegion::Op op)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- return skia::PlatformCanvas::clipPath(path, op);
+ return SkCanvas::clipPath(path, op);
}
virtual bool clipRegion(const SkRegion& region, SkRegion::Op op)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- return skia::PlatformCanvas::clipRegion(region, op);
+ return SkCanvas::clipRegion(region, op);
}
virtual void clear(SkColor color)
@@ -130,14 +130,14 @@
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = true;
m_solidColor = Color(color);
- skia::PlatformCanvas::clear(color);
+ SkCanvas::clear(color);
}
virtual void drawPaint(const SkPaint& paint)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawPaint(paint);
+ SkCanvas::drawPaint(paint);
}
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
@@ -145,7 +145,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawPoints(mode, count, pts, paint);
+ SkCanvas::drawPoints(mode, count, pts, paint);
}
virtual void drawRect(const SkRect& rect, const SkPaint& paint)
@@ -165,14 +165,14 @@
m_isSolidColor = false;
} else
m_isSolidColor = false;
- skia::PlatformCanvas::drawRect(rect, paint);
+ SkCanvas::drawRect(rect, paint);
}
virtual void drawPath(const SkPath& path, const SkPaint& paint)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawPath(path, paint);
+ SkCanvas::drawPath(path, paint);
}
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left,
@@ -180,7 +180,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawBitmap(bitmap, left, top, paint);
+ SkCanvas::drawBitmap(bitmap, left, top, paint);
}
virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src,
@@ -188,7 +188,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawBitmapRect(bitmap, src, dst, paint);
+ SkCanvas::drawBitmapRect(bitmap, src, dst, paint);
}
virtual void drawBitmapMatrix(const SkBitmap& bitmap,
@@ -196,7 +196,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawBitmapMatrix(bitmap, matrix, paint);
+ SkCanvas::drawBitmapMatrix(bitmap, matrix, paint);
}
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
@@ -204,7 +204,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawSprite(bitmap, left, top, paint);
+ SkCanvas::drawSprite(bitmap, left, top, paint);
}
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
@@ -212,7 +212,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawText(text, byteLength, x, y, paint);
+ SkCanvas::drawText(text, byteLength, x, y, paint);
}
virtual void drawPosText(const void* text, size_t byteLength,
@@ -220,7 +220,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawPosText(text, byteLength, pos, paint);
+ SkCanvas::drawPosText(text, byteLength, pos, paint);
}
virtual void drawPosTextH(const void* text, size_t byteLength,
@@ -228,7 +228,7 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawPosTextH(text, byteLength, xpos, constY, paint);
+ SkCanvas::drawPosTextH(text, byteLength, xpos, constY, paint);
}
virtual void drawTextOnPath(const void* text, size_t byteLength,
@@ -236,14 +236,14 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawTextOnPath(text, byteLength, path, matrix, paint);
+ SkCanvas::drawTextOnPath(text, byteLength, path, matrix, paint);
}
virtual void drawPicture(SkPicture& picture)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawPicture(picture);
+ SkCanvas::drawPicture(picture);
}
virtual void drawVertices(VertexMode mode, int vertexCount,
@@ -253,14 +253,14 @@
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawVertices(mode, vertexCount, vertices, texs, colors, xfermode, indices, indexCount, paint);
+ SkCanvas::drawVertices(mode, vertexCount, vertices, texs, colors, xfermode, indices, indexCount, paint);
}
virtual void drawData(const void* data, size_t size)
{
WRAPCANVAS_LOG_ENTRY("");
m_isSolidColor = false;
- skia::PlatformCanvas::drawData(data, size);
+ SkCanvas::drawData(data, size);
}
private:
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h 2012-03-26 17:43:05 UTC (rev 112124)
@@ -54,7 +54,7 @@
class LayerData {
public:
- enum LayerType { Layer, TransformLayer, WebGLLayer };
+ enum LayerType { Layer, TransformLayer, WebGLLayer, CanvasLayer };
enum FilterType { Linear, Nearest, Trilinear, Lanczos };
enum LayerProgramShader { LayerProgramShaderRGBA = 0,
LayerProgramShaderBGRA,
@@ -74,9 +74,6 @@
, m_mediaPlayer(0)
#endif
, m_texID(0)
- , m_texWidth(0)
- , m_texHeight(0)
- , m_canvas(0)
, m_frontBufferLock(0)
, m_suspendTime(0)
, m_doubleSided(true)
@@ -130,7 +127,7 @@
unsigned getTextureID() const { return m_texID; }
void setTextureID(unsigned int value) { m_texID = value; }
- bool needsTexture() const { return m_layerType == WebGLLayer ? true : m_needsTexture; }
+ bool needsTexture() const { return m_layerType == WebGLLayer || m_layerType == CanvasLayer || m_needsTexture; }
LayerProgramShader layerProgramShader() const { return m_layerProgramShader; }
@@ -147,8 +144,6 @@
MediaPlayer* mediaPlayer() const { return m_mediaPlayer; }
#endif
- HTMLCanvasElement* canvas() const { return m_canvas; }
-
void replicate(LayerData *to) const { *to = *this; }
LayerType layerType() const { return m_layerType; }
@@ -193,11 +188,7 @@
IntRect m_holePunchRect;
unsigned m_texID;
- unsigned m_texWidth;
- unsigned m_texHeight;
- HTMLCanvasElement* m_canvas;
-
pthread_mutex_t* m_frontBufferLock;
Vector<RefPtr<LayerAnimation> > m_runningAnimations;
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp 2012-03-26 17:43:05 UTC (rev 112124)
@@ -175,7 +175,7 @@
if (image->isBitmapImage())
isOpaque = !static_cast<BitmapImage*>(image)->currentFrameHasAlpha();
if (NativeImagePtr nativeImage = image->nativeImageForCurrentFrame()) {
- SkBitmap bitmap = SkBitmap(*nativeImage);
+ SkBitmap bitmap = SkBitmap(nativeImage->bitmap());
addTextureJob(TextureJob::setContents(bitmap, isOpaque));
}
} else {
@@ -229,7 +229,7 @@
// No point in tiling an image layer, the image is already stored as an SkBitmap
NativeImagePtr nativeImage = m_layer->contents()->nativeImageForCurrentFrame();
if (nativeImage) {
- SkBitmap bitmap = SkBitmap(*nativeImage);
+ SkBitmap bitmap = SkBitmap(nativeImage->bitmap());
addTextureJob(TextureJob::setContents(bitmap, isOpaque));
}
return;
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp 2012-03-26 17:43:05 UTC (rev 112124)
@@ -108,7 +108,7 @@
if (drawsContent()) { // Layer contents must be drawn into a canvas.
IntRect untransformedContentsRect = contentsRect;
- canvas = adoptPtr(new InstrumentedPlatformCanvas(contentsRect.width(), contentsRect.height(), false, 0));
+ canvas = adoptPtr(new InstrumentedPlatformCanvas(contentsRect.width(), contentsRect.height()));
PlatformContextSkia skiaContext(canvas.get());
GraphicsContext graphicsContext(&skiaContext);
@@ -191,7 +191,7 @@
m_isDrawable = isDrawable;
- setNeedsTexture(m_isDrawable && (drawsContent() || contents() || pluginView() || mediaPlayer() || canvas()));
+ setNeedsTexture(m_isDrawable && (drawsContent() || contents() || pluginView() || mediaPlayer() || m_texID));
setNeedsCommit();
}
Modified: trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp 2012-03-26 17:43:05 UTC (rev 112124)
@@ -709,15 +709,15 @@
return;
loaded = true;
- nativeImage->lockPixels();
+ nativeImage->bitmap().lockPixels();
- int bufSize = nativeImage->width() * nativeImage->height() * 4;
- s_bufferingImageWidth = nativeImage->width();
- s_bufferingImageHeight = nativeImage->height();
+ int bufSize = nativeImage->bitmap().width() * nativeImage->bitmap().height() * 4;
+ s_bufferingImageWidth = nativeImage->bitmap().width();
+ s_bufferingImageHeight = nativeImage->bitmap().height();
s_bufferingImageData = static_cast<char*>(malloc(bufSize));
- memcpy(s_bufferingImageData, nativeImage->getPixels(), bufSize);
+ memcpy(s_bufferingImageData, nativeImage->bitmap().getPixels(), bufSize);
- nativeImage->unlockPixels();
+ nativeImage->bitmap().unlockPixels();
bufferingIcon->deref();
}
}
Deleted: trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferData.h (112123 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferData.h 2012-03-26 17:38:49 UTC (rev 112123)
+++ trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferData.h 2012-03-26 17:43:05 UTC (rev 112124)
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
- * Copyright (c) 2011, Research In Motion. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ImageBufferData_h
-#define ImageBufferData_h
-
-#include "BlackBerryPlatformGraphics.h"
-#include "PlatformContextSkia.h"
-
-#include "skia/ext/platform_canvas.h"
-
-namespace WebCore {
-
-class ImageBufferData {
-public:
- ImageBufferData(const IntSize&);
-
- OwnPtr<SkCanvas> m_canvas;
- PlatformContextSkia m_platformContext;
- BlackBerry::Platform::Graphics::Buffer* m_buffer;
-};
-
-} // namespace WebCore
-
-#endif // ImageBufferData_h
Copied: trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferDataSkia.h (from rev 112123, trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferData.h) (0 => 112124)
--- trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferDataSkia.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/blackberry/skia/ImageBufferDataSkia.h 2012-03-26 17:43:05 UTC (rev 112124)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
+ * Copyright (c) 2011, Research In Motion. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ImageBufferDataSkia_h
+#define ImageBufferDataSkia_h
+
+#include "BlackBerryPlatformGraphics.h"
+#include "PlatformContextSkia.h"
+#if USE(ACCELERATED_COMPOSITING)
+#include "LayerWebKitThread.h"
+#endif
+
+namespace WebCore {
+
+class ImageBufferData {
+public:
+ ImageBufferData(const IntSize&);
+
+ OwnPtr<SkCanvas> m_canvas;
+ PlatformContextSkia m_platformContext;
+ BlackBerry::Platform::Graphics::Buffer* m_buffer;
+#if USE(ACCELERATED_COMPOSITING)
+ RefPtr<LayerWebKitThread> m_platformLayer;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // ImageBufferDataSkia_h