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

Side by Side Diff: android_webview/native/java_browser_view_renderer_helper.cc

Issue 233073003: don't call (deprecated) getTotalClip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/native/java_browser_view_renderer_helper.h" 5 #include "android_webview/native/java_browser_view_renderer_helper.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "android_webview/public/browser/draw_sw.h" 9 #include "android_webview/public/browser/draw_sw.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 JNIEnv* env = base::android::AttachCurrentThread(); 77 JNIEnv* env = base::android::AttachCurrentThread();
78 ScopedPixelAccess auto_release_pixels(env, java_canvas); 78 ScopedPixelAccess auto_release_pixels(env, java_canvas);
79 AwPixelInfo* pixels = auto_release_pixels.pixels(); 79 AwPixelInfo* pixels = auto_release_pixels.pixels();
80 if (pixels && pixels->state) { 80 if (pixels && pixels->state) {
81 skia::RefPtr<SkCanvas> canvas = skia::AdoptRef( 81 skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(
82 SkCanvasStateUtils::CreateFromCanvasState(pixels->state)); 82 SkCanvasStateUtils::CreateFromCanvasState(pixels->state));
83 83
84 // Workarounds for http://crbug.com/271096: SW draw only supports 84 // Workarounds for http://crbug.com/271096: SW draw only supports
85 // translate & scale transforms, and a simple rectangular clip. 85 // translate & scale transforms, and a simple rectangular clip.
86 if (canvas && (!canvas->getTotalClip().isRect() || 86 if (canvas && (!canvas->isClipRect() ||
87 (canvas->getTotalMatrix().getType() & 87 (canvas->getTotalMatrix().getType() &
88 ~(SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)))) { 88 ~(SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)))) {
89 canvas.clear(); 89 canvas.clear();
90 } 90 }
91 if (canvas) { 91 if (canvas) {
92 canvas->translate(scroll_correction.x(), scroll_correction.y()); 92 canvas->translate(scroll_correction.x(), scroll_correction.y());
93 return render_source.Run(canvas.get()); 93 return render_source.Run(canvas.get());
94 } 94 }
95 } 95 }
96 return RenderViaAuxilaryBitmap( 96 return RenderViaAuxilaryBitmap(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 if (AndroidBitmap_unlockPixels(env, jbitmap.obj()) < 0) { 168 if (AndroidBitmap_unlockPixels(env, jbitmap.obj()) < 0) {
169 LOG(ERROR) << "Error unlocking java bitmap pixels."; 169 LOG(ERROR) << "Error unlocking java bitmap pixels.";
170 return false; 170 return false;
171 } 171 }
172 172
173 return succeeded; 173 return succeeded;
174 } 174 }
175 175
176 } // namespace android_webview 176 } // namespace android_webview
OLDNEW
« 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