Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Unified Diff: src/utils/SkGatherPixelRefsAndRects.cpp

Issue 134473002: Pull in Chromium's version of GatherPixelRefs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleaned up Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkGatherPixelRefsAndRects.h ('k') | src/utils/SkPictureUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkGatherPixelRefsAndRects.cpp
===================================================================
--- src/utils/SkGatherPixelRefsAndRects.cpp (revision 0)
+++ src/utils/SkGatherPixelRefsAndRects.cpp (revision 0)
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkGatherPixelRefsAndRects.h"
+#include "SkNoSaveLayerCanvas.h"
+#include "SkPictureUtils.h"
+
+void SkPictureUtils::GatherPixelRefsAndRects(SkPicture* pict,
+ SkPictureUtils::SkPixelRefContainer* prCont) {
+ if (0 == pict->width() || 0 == pict->height()) {
+ return ;
+ }
+
+ SkGatherPixelRefsAndRectsDevice device(pict->width(), pict->height(), prCont);
+ SkNoSaveLayerCanvas canvas(&device);
+
+ canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()),
+ SkIntToScalar(pict->height())),
+ SkRegion::kIntersect_Op, false);
+ canvas.drawPicture(*pict);
+}
Property changes on: src\utils\SkGatherPixelRefsAndRects.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « src/utils/SkGatherPixelRefsAndRects.h ('k') | src/utils/SkPictureUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698