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

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

Issue 13135004: android_webview: changes to support Android GraphicBuffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add GetStride() API on the GraphicBuffer Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/browser_view_renderer_impl.h" 9 #include "android_webview/browser/browser_view_renderer_impl.h"
10 #include "android_webview/browser/graphic_buffer_impl.h"
10 #include "android_webview/browser/net_disk_cache_remover.h" 11 #include "android_webview/browser/net_disk_cache_remover.h"
11 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" 12 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" 13 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
13 #include "android_webview/common/aw_hit_test_data.h" 14 #include "android_webview/common/aw_hit_test_data.h"
14 #include "android_webview/native/aw_browser_dependency_factory.h" 15 #include "android_webview/native/aw_browser_dependency_factory.h"
15 #include "android_webview/native/aw_contents_client_bridge.h" 16 #include "android_webview/native/aw_contents_client_bridge.h"
16 #include "android_webview/native/aw_contents_io_thread_client_impl.h" 17 #include "android_webview/native/aw_contents_io_thread_client_impl.h"
17 #include "android_webview/native/aw_web_contents_delegate.h" 18 #include "android_webview/native/aw_web_contents_delegate.h"
18 #include "android_webview/native/java_browser_view_renderer_helper.h" 19 #include "android_webview/native/java_browser_view_renderer_helper.h"
19 #include "android_webview/native/state_serializer.h" 20 #include "android_webview/native/state_serializer.h"
(...skipping 15 matching lines...) Expand all
35 #include "content/public/browser/navigation_entry.h" 36 #include "content/public/browser/navigation_entry.h"
36 #include "content/public/browser/render_process_host.h" 37 #include "content/public/browser/render_process_host.h"
37 #include "content/public/browser/render_view_host.h" 38 #include "content/public/browser/render_view_host.h"
38 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
39 #include "content/public/common/ssl_status.h" 40 #include "content/public/common/ssl_status.h"
40 #include "jni/AwContents_jni.h" 41 #include "jni/AwContents_jni.h"
41 #include "net/base/x509_certificate.h" 42 #include "net/base/x509_certificate.h"
42 #include "ui/gfx/android/java_bitmap.h" 43 #include "ui/gfx/android/java_bitmap.h"
43 44
44 struct AwDrawSWFunctionTable; 45 struct AwDrawSWFunctionTable;
46 struct AwDrawGLFunctionTable;
45 47
46 using base::android::AttachCurrentThread; 48 using base::android::AttachCurrentThread;
47 using base::android::ConvertJavaStringToUTF16; 49 using base::android::ConvertJavaStringToUTF16;
48 using base::android::ConvertJavaStringToUTF8; 50 using base::android::ConvertJavaStringToUTF8;
49 using base::android::ConvertUTF16ToJavaString; 51 using base::android::ConvertUTF16ToJavaString;
50 using base::android::ConvertUTF8ToJavaString; 52 using base::android::ConvertUTF8ToJavaString;
51 using base::android::JavaRef; 53 using base::android::JavaRef;
52 using base::android::ScopedJavaGlobalRef; 54 using base::android::ScopedJavaGlobalRef;
53 using base::android::ScopedJavaLocalRef; 55 using base::android::ScopedJavaLocalRef;
54 using components::InterceptNavigationDelegate; 56 using components::InterceptNavigationDelegate;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 delete this; 176 delete this;
175 } 177 }
176 178
177 // static 179 // static
178 void SetAwDrawSWFunctionTable(JNIEnv* env, jclass, jint function_table) { 180 void SetAwDrawSWFunctionTable(JNIEnv* env, jclass, jint function_table) {
179 BrowserViewRendererImpl::SetAwDrawSWFunctionTable( 181 BrowserViewRendererImpl::SetAwDrawSWFunctionTable(
180 reinterpret_cast<AwDrawSWFunctionTable*>(function_table)); 182 reinterpret_cast<AwDrawSWFunctionTable*>(function_table));
181 } 183 }
182 184
183 // static 185 // static
186 void SetAwDrawGLFunctionTable(JNIEnv* env, jclass, jint function_table) {
187 GraphicBufferImpl::SetAwDrawGLFunctionTable(
188 reinterpret_cast<AwDrawGLFunctionTable*>(function_table));
189 }
190
191 // static
184 jint GetAwDrawGLFunction(JNIEnv* env, jclass) { 192 jint GetAwDrawGLFunction(JNIEnv* env, jclass) {
185 return reinterpret_cast<jint>(&DrawGLFunction); 193 return reinterpret_cast<jint>(&DrawGLFunction);
186 } 194 }
187 195
188 jint AwContents::GetAwDrawGLViewContext(JNIEnv* env, jobject obj) { 196 jint AwContents::GetAwDrawGLViewContext(JNIEnv* env, jobject obj) {
189 return reinterpret_cast<jint>(browser_view_renderer_.get()); 197 return reinterpret_cast<jint>(browser_view_renderer_.get());
190 } 198 }
191 199
192 namespace { 200 namespace {
193 void DocumentHasImagesCallback(const ScopedJavaGlobalRef<jobject>& message, 201 void DocumentHasImagesCallback(const ScopedJavaGlobalRef<jobject>& message,
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (enabled) { 707 if (enabled) {
700 mode = invalidation_only ? 708 mode = invalidation_only ?
701 BrowserViewRenderer::kOnNewPictureInvalidationOnly : 709 BrowserViewRenderer::kOnNewPictureInvalidationOnly :
702 BrowserViewRenderer::kOnNewPictureEnabled; 710 BrowserViewRenderer::kOnNewPictureEnabled;
703 } 711 }
704 712
705 browser_view_renderer_->EnableOnNewPicture(mode); 713 browser_view_renderer_->EnableOnNewPicture(mode);
706 } 714 }
707 715
708 } // namespace android_webview 716 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698