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

Unified Diff: src/utils/SkDataUtils.cpp

Issue 274463004: Revert of extract some common code from PictureRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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/SkDataUtils.h ('k') | tools/PictureRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDataUtils.cpp
diff --git a/src/utils/SkDataUtils.cpp b/src/utils/SkDataUtils.cpp
deleted file mode 100644
index c5544f71ba3e5a8dc9d74ae0a8b2670564455d32..0000000000000000000000000000000000000000
--- a/src/utils/SkDataUtils.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 "SkData.h"
-#include "SkDataUtils.h"
-#include "SkStream.h"
-
-/*static*/ SkData* SkDataUtils::ReadIntoSkData(SkStream &stream, size_t maxBytes) {
- if (0 == maxBytes) {
- return SkData::NewEmpty();
- }
- char* bufStart = reinterpret_cast<char *>(sk_malloc_throw(maxBytes));
- char* bufPtr = bufStart;
- size_t bytesRemaining = maxBytes;
- while (bytesRemaining > 0) {
- size_t bytesReadThisTime = stream.read(bufPtr, bytesRemaining);
- if (0 == bytesReadThisTime) {
- break;
- }
- bytesRemaining -= bytesReadThisTime;
- bufPtr += bytesReadThisTime;
- }
- return SkData::NewFromMalloc(bufStart, maxBytes - bytesRemaining);
-}
« no previous file with comments | « src/utils/SkDataUtils.h ('k') | tools/PictureRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698