OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser/in_process_view_renderer.h" | 5 #include "android_webview/browser/in_process_view_renderer.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "android_webview/browser/aw_gl_surface.h" | 9 #include "android_webview/browser/aw_gl_surface.h" |
10 #include "android_webview/browser/scoped_app_gl_state_restore.h" | 10 #include "android_webview/browser/scoped_app_gl_state_restore.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 if (AndroidBitmap_unlockPixels(env, jbitmap.obj()) < 0) { | 102 if (AndroidBitmap_unlockPixels(env, jbitmap.obj()) < 0) { |
103 LOG(ERROR) << "Error unlocking java bitmap pixels."; | 103 LOG(ERROR) << "Error unlocking java bitmap pixels."; |
104 return false; | 104 return false; |
105 } | 105 } |
106 | 106 |
107 return succeeded; | 107 return succeeded; |
108 } | 108 } |
109 | 109 |
110 bool RenderPictureToCanvas(SkPicture* picture, SkCanvas* canvas) { | |
111 canvas->drawPicture(*picture); | |
112 return true; | |
113 } | |
114 | |
115 class ScopedPixelAccess { | 110 class ScopedPixelAccess { |
116 public: | 111 public: |
117 ScopedPixelAccess(JNIEnv* env, jobject java_canvas) { | 112 ScopedPixelAccess(JNIEnv* env, jobject java_canvas) { |
118 AwDrawSWFunctionTable* sw_functions = | 113 AwDrawSWFunctionTable* sw_functions = |
119 BrowserViewRenderer::GetAwDrawSWFunctionTable(); | 114 BrowserViewRenderer::GetAwDrawSWFunctionTable(); |
120 pixels_ = sw_functions ? | 115 pixels_ = sw_functions ? |
121 sw_functions->access_pixels(env, java_canvas) : NULL; | 116 sw_functions->access_pixels(env, java_canvas) : NULL; |
122 } | 117 } |
123 ~ScopedPixelAccess() { | 118 ~ScopedPixelAccess() { |
124 if (pixels_) | 119 if (pixels_) |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 base::StringAppendF(&str, | 988 base::StringAppendF(&str, |
994 "surface width height: [%d %d] ", | 989 "surface width height: [%d %d] ", |
995 draw_info->width, | 990 draw_info->width, |
996 draw_info->height); | 991 draw_info->height); |
997 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); | 992 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); |
998 } | 993 } |
999 return str; | 994 return str; |
1000 } | 995 } |
1001 | 996 |
1002 } // namespace android_webview | 997 } // namespace android_webview |
OLD | NEW |