Chromium Code Reviews| Index: Source/platform/graphics/InterceptingCanvas.cpp |
| diff --git a/Source/platform/graphics/InterceptingCanvas.cpp b/Source/platform/graphics/InterceptingCanvas.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..66907aa665dcbb315e35ba713c1ac9644836c8de |
| --- /dev/null |
| +++ b/Source/platform/graphics/InterceptingCanvas.cpp |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| +#include "platform/graphics/InterceptingCanvas.h" |
| + |
| +namespace blink { |
| + |
| +void InterceptingCanvasBase::unrollDrawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint, SkPicture::AbortCallback* abortCallback) |
| +{ |
| + int saveCount = this->getSaveCount(); |
| + if (paint) { |
| + SkRect newBounds = picture->cullRect(); |
|
f(malita)
2015/06/17 18:20:56
Nit: the 'bounds' saveLayer arg is optional, so I
caseq
2015/06/17 18:29:47
Would it be the same performance-wise? I was think
f(malita)
2015/06/17 18:41:56
It defaults to using the current clip bounds, but
|
| + if (matrix) |
| + matrix->mapRect(&newBounds); |
| + this->saveLayer(&newBounds, paint); |
| + } else if (matrix) { |
| + this->save(); |
| + } |
| + if (matrix) |
| + this->concat(*matrix); |
| + |
| + picture->playback(this, abortCallback); |
| + |
| + this->restoreToCount(saveCount); |
| +} |
| + |
| +} // namespace blink |