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

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: Remove DEPS file changes 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..6a6e6708ff78d99405ce6e10fade9932f7e8b899 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,8 +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) {
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture);
return picture;
}
@@ -156,10 +157,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();
+ skia::RefPtr<SkPicture> picture(skia::AdoptRef(recorder.endRecording()));
f(malita) 2014/04/29 17:26:59 return skia::AdoptRef(recorder.endRecording());
robertphillips 2014/04/29 19:14:31 Done.
return picture;
}
« 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