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

Unified Diff: src/gpu/GrTextureToYUVPlanes.cpp

Issue 1663013004: Reduce stack usage for Google3. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextureToYUVPlanes.cpp
diff --git a/src/gpu/GrTextureToYUVPlanes.cpp b/src/gpu/GrTextureToYUVPlanes.cpp
index 6a8d7b6676e43a684c92e936419289a4b192cdd1..19283eef4b56ff8740d98e0092a424b0c3bb727c 100644
--- a/src/gpu/GrTextureToYUVPlanes.cpp
+++ b/src/gpu/GrTextureToYUVPlanes.cpp
@@ -170,7 +170,12 @@ bool GrTextureToYUVPlanes(GrTexture* texture, const SkISize sizes[3], void* cons
SkASSERT(sizes[0] == sizes[1] && sizes[1] == sizes[2]);
SkISize yuvSize = sizes[0];
// We have no kRGB_888 pixel format, so readback rgba and then copy three channels.
+#if defined(GOOGLE3)
+ // Stack frame size is limited in GOOGLE3.
+ SkAutoSTMalloc<48 * 48, uint32_t> tempYUV(yuvSize.fWidth * yuvSize.fHeight);
+#else
SkAutoSTMalloc<128 * 128, uint32_t> tempYUV(yuvSize.fWidth * yuvSize.fHeight);
+#endif
if (!yuvTex->readPixels(0, 0, yuvSize.fWidth, yuvSize.fHeight,
kRGBA_8888_GrPixelConfig, tempYUV.get(), 0)) {
return false;
@@ -207,7 +212,12 @@ bool GrTextureToYUVPlanes(GrTexture* texture, const SkISize sizes[3], void* cons
SkASSERT(sizes[1].fWidth == sizes[2].fWidth);
SkISize uvSize = sizes[1];
// We have no kRG_88 pixel format, so readback rgba and then copy two channels.
+#if defined(GOOGLE3)
+ // Stack frame size is limited in GOOGLE3.
+ SkAutoSTMalloc<48 * 48, uint32_t> tempUV(uvSize.fWidth * uvSize.fHeight);
+#else
SkAutoSTMalloc<128 * 128, uint32_t> tempUV(uvSize.fWidth * uvSize.fHeight);
+#endif
if (!uvTex->readPixels(0, 0, uvSize.fWidth, uvSize.fHeight,
kRGBA_8888_GrPixelConfig, tempUV.get(), 0)) {
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698