WebKit draws directly using skia, so you can't intercept it.

On Wed, Jun 16, 2010 at 11:34 AM, Mehdy <[email protected]> wrote:

> In an struggle to fix something in drawing of Webkit engine I ended up
> with this code to change the canvas to my canvas on the draw method:
>
>
> class MyWebView extends WebView {
>
>        public MyWebView(Context context) {
>                super(context);
>                // TODO Auto-generated constructor stub
>        }
>
>        protected void onDraw (Canvas canvas) {
>                //MyCanvas c = new MyCanvas(canvas);
>
>                Bitmap bitmap = Bitmap.createBitmap(canvas.getWidth(),
> canvas.getHeight(),
>                                Bitmap.Config.ARGB_8888);
>
>                MyCanvas m = new MyCanvas(bitmap);
>
>                m.setMatrix(canvas.getMatrix());
>
>                super.onDraw(m);
>
>                Rect r = canvas.getClipBounds();
>                canvas.drawBitmap(bitmap, r.left, r.top, null);
>                canvas.drawText("MyPageVersion", r.left+20, r.top+20, new
> Paint());
>
>        }
>
> }
>
>
> MyCanvas is extended Canvas and override almost all functions (all
> drawing functions) but none of the will call by the OnDraw method of
> WebView.
>
> I've chased the chain of method calls and reached native methods and
> my only explanation is android Native codes to not respect method
> overriding and call the original version of methods in Canvas.
>
> Anybody nows anything about this issue?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to