gfx/skia/trunk/src/utils/SkGatherPixelRefsAndRects.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/utils/SkGatherPixelRefsAndRects.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,25 @@
     1.4 +/*
     1.5 + * Copyright 2014 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#include "SkGatherPixelRefsAndRects.h"
    1.12 +#include "SkNoSaveLayerCanvas.h"
    1.13 +#include "SkPictureUtils.h"
    1.14 +
    1.15 +void SkPictureUtils::GatherPixelRefsAndRects(SkPicture* pict,
    1.16 +                                             SkPictureUtils::SkPixelRefContainer* prCont) {
    1.17 +    if (0 == pict->width() || 0 == pict->height()) {
    1.18 +        return ;
    1.19 +    }
    1.20 +
    1.21 +    SkGatherPixelRefsAndRectsDevice device(pict->width(), pict->height(), prCont);
    1.22 +    SkNoSaveLayerCanvas canvas(&device);
    1.23 +
    1.24 +    canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()),
    1.25 +                                   SkIntToScalar(pict->height())),
    1.26 +                    SkRegion::kIntersect_Op, false);
    1.27 +    canvas.drawPicture(*pict);
    1.28 +}

mercurial