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

Unified Diff: src/core/SkMipMapLevel.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fixing bad rebase. Created 5 years, 2 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
Index: src/core/SkMipMapLevel.cpp
diff --git a/src/core/SkMipMapLevel.cpp b/src/core/SkMipMapLevel.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..85e66c617ab543d7c3def5bd544eca8b16c250c2
--- /dev/null
+++ b/src/core/SkMipMapLevel.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#include "SkMipMapLevel.h"
+
+SkMipMapLevel::SkMipMapLevel(const void* texels, size_t rowBytes, uint32_t width, uint32_t height)
+ : fTexels(texels)
+ , fRowBytes(rowBytes)
+ , fWidth(width)
+ , fHeight(height)
+{
+}
+
+SkMipMapLevel::SkMipMapLevel(SkMipMapLevel&& rhs)
+ : fTexels(rhs.fTexels)
+ , fRowBytes(rhs.fRowBytes)
+ , fWidth(rhs.fWidth)
+ , fHeight(rhs.fHeight)
+{
+ rhs.fTexels = nullptr;
+ rhs.fRowBytes = 0;
+ rhs.fWidth = 0;
+ rhs.fHeight = 0;
+}
+
+SkMipMapLevel& SkMipMapLevel::operator =(SkMipMapLevel&& rhs)
+{
+ fTexels = rhs.fTexels;
+ fRowBytes = rhs.fRowBytes;
+ fWidth = rhs.fWidth;
+ fHeight = rhs.fHeight;
+
+ rhs.fTexels = nullptr;
+ rhs.fRowBytes = 0;
+ rhs.fWidth = 0;
+ rhs.fHeight = 0;
+
+ return *this;
+}

Powered by Google App Engine
This is Rietveld 408576698