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

Unified Diff: content/renderer/skia_benchmarking_extension.cc

Issue 184743002: don't create SkDevice directly, use SkBitmap or (better) SkCanvas::NewRaster factory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert changes to media unittests til we understand valgrind errors 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: content/renderer/skia_benchmarking_extension.cc
diff --git a/content/renderer/skia_benchmarking_extension.cc b/content/renderer/skia_benchmarking_extension.cc
index 7c957a57a93e995fd39c01ed2bfa6d900431e31f..c0656b7e0090a8aa4a3fe245b0ea7c2d1ac0df18 100644
--- a/content/renderer/skia_benchmarking_extension.cc
+++ b/content/renderer/skia_benchmarking_extension.cc
@@ -19,7 +19,6 @@
#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"
@@ -263,10 +262,9 @@ void SkiaBenchmarking::GetOpTimings(gin::Arguments* args) {
gfx::Rect bounds = picture->LayerRect();
// Measure the total time by drawing straight into a bitmap-backed canvas.
- skia::RefPtr<SkBaseDevice> device = skia::AdoptRef(SkNEW_ARGS(
- SkBitmapDevice,
- (SkBitmap::kARGB_8888_Config, bounds.width(), bounds.height())));
- SkCanvas bitmap_canvas(device.get());
+ SkBitmap bitmap;
+ bitmap.allocN32Pixels(bounds.width(), bounds.height());
+ SkCanvas bitmap_canvas(bitmap);
bitmap_canvas.clear(SK_ColorTRANSPARENT);
base::TimeTicks t0 = base::TimeTicks::HighResNow();
picture->Replay(&bitmap_canvas);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_browsertest.cc ('k') | skia/ext/benchmarking_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698