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

Unified Diff: android_webview/native/aw_picture.cc

Issue 797753003: use picture->cullRect instead of (deprecated) width/height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | cc/resources/picture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_picture.cc
diff --git a/android_webview/native/aw_picture.cc b/android_webview/native/aw_picture.cc
index 7ba4fd857779ff511a7deee509fc507cfd0c8c2e..625999d848c8dada7edbd6f9def2a5da67a665ce 100644
--- a/android_webview/native/aw_picture.cc
+++ b/android_webview/native/aw_picture.cc
@@ -23,17 +23,18 @@ void AwPicture::Destroy(JNIEnv* env, jobject obj) {
}
jint AwPicture::GetWidth(JNIEnv* env, jobject obj) {
- return picture_->width();
+ return picture_->cullRect().roundOut().width();
}
jint AwPicture::GetHeight(JNIEnv* env, jobject obj) {
- return picture_->height();
+ return picture_->cullRect().roundOut().height();
}
void AwPicture::Draw(JNIEnv* env, jobject obj, jobject canvas) {
+ const SkIRect bounds = picture_->cullRect().roundOut();
scoped_ptr<SoftwareCanvasHolder> canvas_holder = SoftwareCanvasHolder::Create(
canvas, gfx::Vector2d(),
- gfx::Size(picture_->width(), picture_->height()));
+ gfx::Size(bounds.width(), bounds.height()));
if (!canvas_holder || !canvas_holder->GetCanvas()) {
LOG(ERROR) << "Couldn't draw picture";
return;
« no previous file with comments | « no previous file | cc/resources/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698