Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / android_webview / native / java_browser_view_renderer_helper.h
blob5ff938d9c284f839df79088c80f18624a7dcea16
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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_
6 #define ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_
8 #include "android_webview/browser/browser_view_renderer.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "base/compiler_specific.h"
12 namespace android_webview {
14 // Native side of java-class of same name.
15 // Provides utility methods for rendering involving with Java objects.
16 // TODO(boliu): Rename this class to JavaRasterHelper.
17 class JavaBrowserViewRendererHelper : public BrowserViewRendererJavaHelper {
18 public:
19 JavaBrowserViewRendererHelper();
20 virtual ~JavaBrowserViewRendererHelper();
22 static void SetAwDrawSWFunctionTable(AwDrawSWFunctionTable* table);
23 static JavaBrowserViewRendererHelper* GetInstance();
25 // BrowserViewRendererJavaHelper implementation.
26 virtual bool RenderViaAuxilaryBitmapIfNeeded(
27 jobject java_canvas,
28 const gfx::Vector2d& scroll_correction,
29 const gfx::Size& auxiliary_bitmap_size,
30 RenderMethod render_source) OVERRIDE;
32 private:
33 bool RenderViaAuxilaryBitmap(JNIEnv* env,
34 jobject java_canvas,
35 const gfx::Vector2d& scroll_correction,
36 const gfx::Size& auxiliary_bitmap_size,
37 const RenderMethod& render_source);
38 bool RasterizeIntoBitmap(
39 JNIEnv* env,
40 const base::android::JavaRef<jobject>& jbitmap,
41 const JavaBrowserViewRendererHelper::RenderMethod& renderer);
44 bool RegisterJavaBrowserViewRendererHelper(JNIEnv* env);
46 } // namespace android_webview
48 #endif // ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_