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

Unified Diff: android_webview/browser/browser_view_renderer.cc

Issue 251843005: Fixing Chromium Android build's reliance on old SkPicture recording API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed code review issues Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/browser_view_renderer.cc
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc
index 937ed13259c1de75bde6d7c190b38566373c5351..9e9711d032e51607f2bef8b54a62823b0befdf04 100644
--- a/android_webview/browser/browser_view_renderer.cc
+++ b/android_webview/browser/browser_view_renderer.cc
@@ -17,6 +17,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPicture.h"
+#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "ui/gfx/vector2d_conversions.h"
using base::android::AttachCurrentThread;
@@ -146,9 +147,8 @@ skia::RefPtr<SkPicture> BrowserViewRenderer::CapturePicture(int width,
TRACE_EVENT0("android_webview", "BrowserViewRenderer::CapturePicture");
// Return empty Picture objects for empty SkPictures.
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture);
if (width <= 0 || height <= 0) {
- return picture;
+ return skia::AdoptRef(new SkPicture);
}
// Reset scroll back to the origin, will go back to the old
@@ -156,11 +156,11 @@ skia::RefPtr<SkPicture> BrowserViewRenderer::CapturePicture(int width,
AutoResetWithLock scroll_reset(
&scroll_offset_dip_, gfx::Vector2dF(), scroll_offset_dip_lock_);
- SkCanvas* rec_canvas = picture->beginRecording(width, height, 0);
+ SkPictureRecorder recorder;
+ SkCanvas* rec_canvas = recorder.beginRecording(width, height, NULL, 0);
if (has_compositor_)
CompositeSW(rec_canvas);
- picture->endRecording();
- return picture;
+ return skia::AdoptRef(recorder.endRecording());
}
void BrowserViewRenderer::EnableOnNewPicture(bool enabled) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698