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

Unified Diff: trunk/src/content/renderer/skia_benchmarking_extension.cc

Issue 183003011: Revert 254567 "don't create SkDevice directly, use SkBitmap or (..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 months 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: trunk/src/content/renderer/skia_benchmarking_extension.cc
===================================================================
--- trunk/src/content/renderer/skia_benchmarking_extension.cc (revision 254711)
+++ trunk/src/content/renderer/skia_benchmarking_extension.cc (working copy)
@@ -19,6 +19,7 @@
#include "third_party/WebKit/public/web/WebArrayBufferConverter.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebKit.h"
+#include "third_party/skia/include/core/SkBitmapDevice.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkGraphics.h"
@@ -262,9 +263,10 @@
gfx::Rect bounds = picture->LayerRect();
// Measure the total time by drawing straight into a bitmap-backed canvas.
- SkBitmap bitmap;
- bitmap.allocN32Pixels(bounds.width(), bounds.height());
- SkCanvas bitmap_canvas(bitmap);
+ skia::RefPtr<SkBaseDevice> device = skia::AdoptRef(SkNEW_ARGS(
+ SkBitmapDevice,
+ (SkBitmap::kARGB_8888_Config, bounds.width(), bounds.height())));
+ SkCanvas bitmap_canvas(device.get());
bitmap_canvas.clear(SK_ColorTRANSPARENT);
base::TimeTicks t0 = base::TimeTicks::HighResNow();
picture->Replay(&bitmap_canvas);

Powered by Google App Engine
This is Rietveld 408576698