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

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 295093003: Revert of Revert ""Revert of eliminate config param -- it was always self's config (https://codereview.chromi… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
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/core/SkBitmap.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 85de28577961bc70d9994238391479252a669fbf..fd21f1073bf1560a34a95d8b0ac8cdecebd22d33 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -51,7 +51,8 @@
///////////////////////////////////////////////////////////////////////////////
-static SkGrPixelRef* copyToTexturePixelRef(GrTexture* texture, const SkIRect* subset) {
+static SkGrPixelRef* copyToTexturePixelRef(GrTexture* texture, SkBitmap::Config dstConfig,
+ const SkIRect* subset) {
if (NULL == texture) {
return NULL;
}
@@ -76,7 +77,7 @@
topLeft = NULL;
}
desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
- desc.fConfig = texture->config();
+ desc.fConfig = SkBitmapConfig2GrPixelConfig(dstConfig);
SkImageInfo info;
if (!GrPixelConfig2ColorType(desc.fConfig, &info.fColorType)) {
@@ -151,7 +152,7 @@
return NULL;
}
-SkPixelRef* SkGrPixelRef::deepCopy(const SkIRect* subset) {
+SkPixelRef* SkGrPixelRef::deepCopy(SkBitmap::Config dstConfig, const SkIRect* subset) {
if (NULL == fSurface) {
return NULL;
}
@@ -162,7 +163,7 @@
// 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(), subset);
+ return copyToTexturePixelRef(fSurface->asTexture(), dstConfig, subset);
}
bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) {
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698