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

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 608353002: Cherry-pick of https://skia.googlesource.com/skia.git/+/96c118edff293af93db0a2b1b6775428117924b1 to… (Closed) Base URL: https://skia.googlesource.com/skia.git@m38_2125
Patch Set: Created 6 years, 3 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/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGrPixelRef.cpp
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index 2131f41b17b3686c07e01afc002d0680d01906c4..b064b7e6ae8a93e2dfe04e6814374ea524cefd94 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -51,7 +51,7 @@ bool SkROLockPixelsPixelRef::onLockPixelsAreWritable() const {
///////////////////////////////////////////////////////////////////////////////
-static SkGrPixelRef* copyToTexturePixelRef(GrTexture* texture, SkColorType dstCT,
+static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorType dstCT,
const SkIRect* subset) {
if (NULL == texture || kUnknown_SkColorType == dstCT) {
return NULL;
@@ -86,15 +86,10 @@ static SkGrPixelRef* copyToTexturePixelRef(GrTexture* texture, SkColorType dstCT
context->copyTexture(texture, dst->asRenderTarget(), topLeft);
- // TODO: figure out if this is responsible for Chrome canvas errors
-#if 0
- // The render texture we have created (to perform the copy) isn't fully
- // functional (since it doesn't have a stencil buffer). Release it here
- // so the caller doesn't try to render to it.
- // TODO: we can undo this release when dynamic stencil buffer attach/
- // detach has been implemented
- dst->releaseRenderTarget();
-#endif
+ // Blink is relying on the above copy being sent to GL immediately in the case when the source
+ // is a WebGL canvas backing store. We could have a TODO to remove this flush, but we have a
+ // larger TODO to remove SkGrPixelRef entirely.
+ context->flush();
SkImageInfo info = SkImageInfo::Make(desc.fWidth, desc.fHeight, dstCT, kPremul_SkAlphaType);
SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (info, dst));
@@ -156,7 +151,7 @@ SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, const SkIRect* subset) {
// a GrTexture owned elsewhere (e.g., SkGpuDevice), and cannot live
// independently of that texture. Texture-backed pixel refs, on the other
// hand, own their GrTextures, and are thus self-contained.
- return copyToTexturePixelRef(fSurface->asTexture(), dstCT, subset);
+ return copy_to_new_texture_pixelref(fSurface->asTexture(), dstCT, subset);
}
bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) {
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698