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

Side by Side Diff: Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp

Issue 10444013: Merge 117191 - Assertion failure running Mozilla's WebGL performance regression tests (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 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 unified diff | Download patch
« no previous file with comments | « Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 skiaImage = pixels.get(); 72 skiaImage = pixels.get();
73 if (hasAlpha && premultiplyAlpha) 73 if (hasAlpha && premultiplyAlpha)
74 neededAlphaOp = AlphaDoPremultiply; 74 neededAlphaOp = AlphaDoPremultiply;
75 } else if (!premultiplyAlpha && hasAlpha) 75 } else if (!premultiplyAlpha && hasAlpha)
76 neededAlphaOp = AlphaDoUnmultiply; 76 neededAlphaOp = AlphaDoUnmultiply;
77 if (!skiaImage) 77 if (!skiaImage)
78 return false; 78 return false;
79 const SkBitmap& skiaImageRef = skiaImage->bitmap(); 79 const SkBitmap& skiaImageRef = skiaImage->bitmap();
80 SkAutoLockPixels lock(skiaImageRef); 80 SkAutoLockPixels lock(skiaImageRef);
81 ASSERT(skiaImageRef.rowBytes() == skiaImageRef.width() * 4); 81 ASSERT(skiaImageRef.rowBytes() == skiaImageRef.width() * 4);
82 outputVector.resize(skiaImageRef.rowBytes() * skiaImageRef.height()); 82 unsigned int packedSize;
83 // Output data is tightly packed (alignment == 1).
84 if (computeImageSizeInBytes(format, type, skiaImageRef.width(), skiaImageRef .height(), 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
85 return false;
86 outputVector.resize(packedSize);
83 return packPixels(reinterpret_cast<const uint8_t*>(skiaImageRef.getPixels()) , 87 return packPixels(reinterpret_cast<const uint8_t*>(skiaImageRef.getPixels()) ,
84 SK_B32_SHIFT ? SourceFormatRGBA8 : SourceFormatBGRA8, 88 SK_B32_SHIFT ? SourceFormatRGBA8 : SourceFormatBGRA8,
85 skiaImageRef.width(), skiaImageRef.height(), 0, 89 skiaImageRef.width(), skiaImageRef.height(), 0,
86 format, type, neededAlphaOp, outputVector.data()); 90 format, type, neededAlphaOp, outputVector.data());
87 } 91 }
88 92
89 } // namespace WebCore 93 } // namespace WebCore
90 94
91 #endif // ENABLE(WEBGL) 95 #endif // ENABLE(WEBGL)
OLDNEW
« no previous file with comments | « Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698