Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1507)

Unified Diff: Source/platform/graphics/UnacceleratedImageBufferSurface.cpp

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fixes for win+mac Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
diff --git a/Source/core/platform/graphics/GaneshUtils.h b/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
similarity index 73%
copy from Source/core/platform/graphics/GaneshUtils.h
copy to Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
index a86b0efb597435880efd77b9d991c2fa102fd756..90f5c20b305fd1775837d00b658daa19907d4366 100644
--- a/Source/core/platform/graphics/GaneshUtils.h
+++ b/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
@@ -28,17 +28,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GaneshUtils_h
-#define GaneshUtils_h
+#include "config.h"
-#include "platform/geometry/IntSize.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/gpu/GrContext.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "wtf/PassOwnPtr.h"
namespace WebCore {
-bool ensureTextureBackedSkBitmap(GrContext*, SkBitmap&, const IntSize&, GrSurfaceOrigin, GrPixelConfig);
+UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode, float resolutionScale)
+ : ImageBufferSurface(size, opacityMode, resolutionScale)
+{
+ SkBitmap bitmap;
+ bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+ bitmap.allocPixels();
+ if (bitmap.isNull())
+ return;
+ m_canvas = adoptPtr(new SkCanvas(bitmap));
+ clear();
+}
} // namespace WebCore
-
-#endif // GaneshUtils_h

Powered by Google App Engine
This is Rietveld 408576698