JSFiddle - React, Tailwind, and code Playground
by Abhijeet Kandalkar
HTML
/*
functions->fCreateImage = 0; //glCreateImageCHROMIUM;
functions->fMapImage = 0; //glMapImageCHROMIUM;
functions->fUnMapImage = 0; //glUnmapImageCHROMIUM;
functions->fBindImage = 0; //glBindTexImage2DCHROMIUM;
*/
CSS
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index e880539..738ecd2 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -425,6 +425,8 @@ SecurityOrigin* HTMLCanvasElement::securityOrigin() const
bool HTMLCanvasElement::shouldAccelerate(const IntSize& size) const
{
+ return true;
+
if (m_context && !m_context->is2d())
return false;
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index ccca4dd..11036f1 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1508,6 +1508,8 @@ void CanvasRenderingContext2D::drawImageInternal(CanvasImageSource* imageSource,
drawVideo(static_cast<HTMLVideoElement*>(imageSource), srcRect, dstRect);
computeDirtyRect(dstRect, clipBounds, &dirtyRect);
} else {
+ image->setGLBackedImage(true);
+
if (rectContainsTransformedRect(dstRect, clipBounds)) {
c->drawImage(image.get(), dstRect, srcRect, op, blendMode);
} else if (isFullCanvasCompositeMode(op)) {
diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
index a62674f..a5f2b0b 100644
--- a/Source/platform/graphics/BitmapImage.cpp
+++ b/Source/platform/graphics/BitmapImage.cpp
@@ -38,6 +38,7 @@
#include "wtf/PassRefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
+#include "SkBitmap.h"
namespace WebCore {
@@ -275,6 +276,10 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const Fl
if (!bm)
return; // It's too early and we don't have an image yet.
+ SkBitmap* ptr = const_cast<SkBitmap*>(&(bm->bitmap()));
+ ptr->setIsGLBacked(true);
+ //bm->bitmap().setIsGLBacked(isGLBacked);
+
FloatRect normDstRect = adjustForNegativeSize(dstRect);
FloatRect normSrcRect =...
JavaScript
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 0e847f2..88adf06 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -157,6 +157,11 @@ public:
*/
size_t getSize() const { return fInfo.fHeight * fRowBytes; }
+ unsigned image() const { return imgId; }
+ void setImage(unsigned img) { imgId = img; }
+
+ void* context3D() const { return context; }
+ void setContext3D(void* ctx) { context = ctx; }
/** Return the number of bytes from the pointer returned by getPixels()
to the end of the allocated space in the buffer. Required in
cases where extractSubset has been called.
@@ -308,7 +313,7 @@ public:
@param ctable ColorTable (or null) that matches the specified pixels
*/
void setPixels(void* p, SkColorTable* ctable = NULL);
-
+ void setGrPixels(void* p, SkImageInfo info, GrTexture* tex);
/** Copies the bitmap's pixels to the location pointed at by dst and returns
true if possible, returns false otherwise.
@@ -752,6 +757,9 @@ private:
static void WriteRawPixels(SkWriteBuffer*, const SkBitmap&);
static bool ReadRawPixels(SkReadBuffer*, SkBitmap*);
+ //id here
+ unsigned imgId;
+ void* context;
friend class SkBitmapSource; // unflatten
friend class SkReadBuffer; // unflatten, rawpixels
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index f533851..07cb2bf 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -228,7 +228,9 @@ public:
const GrCacheID& cacheID,
const void* srcData,
size_t rowBytes,
- GrResourceKey* cacheKey = NULL);
+ GrResourceKey* cacheKey = NULL,
+ void* context3d = 0,
+ unsigned imgId = 0);
/**
* Search for an entry based on key and dimensions. If found,...