Loading libs/hwui/Canvas.h +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ public: * It is useful for testing and clients (e.g. Picture/Movie) that expect to * draw their contents into an SkCanvas. * * The SkCanvas returned is *only* valid until another Canvas call is made * that would change state (e.g. matrix or clip). Clients of asSkCanvas() * are responsible for *not* persisting this pointer. * * Further, the returned SkCanvas should NOT be unref'd and is valid until * this canvas is destroyed or a new bitmap is set. */ Loading libs/hwui/DisplayListCanvas.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,14 @@ SkCanvas* DisplayListCanvas::asSkCanvas() { if (!mSkiaCanvasProxy) { mSkiaCanvasProxy.reset(new SkiaCanvasProxy(this)); } // SkCanvas instances default to identity transform, but should inherit // the state of this Canvas; if this code was in the SkiaCanvasProxy // constructor, we couldn't cache mSkiaCanvasProxy. SkMatrix parentTransform; getMatrix(&parentTransform); mSkiaCanvasProxy.get()->setMatrix(parentTransform); return mSkiaCanvasProxy.get(); } Loading Loading
libs/hwui/Canvas.h +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ public: * It is useful for testing and clients (e.g. Picture/Movie) that expect to * draw their contents into an SkCanvas. * * The SkCanvas returned is *only* valid until another Canvas call is made * that would change state (e.g. matrix or clip). Clients of asSkCanvas() * are responsible for *not* persisting this pointer. * * Further, the returned SkCanvas should NOT be unref'd and is valid until * this canvas is destroyed or a new bitmap is set. */ Loading
libs/hwui/DisplayListCanvas.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,14 @@ SkCanvas* DisplayListCanvas::asSkCanvas() { if (!mSkiaCanvasProxy) { mSkiaCanvasProxy.reset(new SkiaCanvasProxy(this)); } // SkCanvas instances default to identity transform, but should inherit // the state of this Canvas; if this code was in the SkiaCanvasProxy // constructor, we couldn't cache mSkiaCanvasProxy. SkMatrix parentTransform; getMatrix(&parentTransform); mSkiaCanvasProxy.get()->setMatrix(parentTransform); return mSkiaCanvasProxy.get(); } Loading