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

Side by Side Diff: src/image/SkImage_Gpu.cpp

Issue 1404433002: Remove image usage type enum. Use GrTextureParams instead. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no gpu build 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 unified diff | Download patch
« no previous file with comments | « src/image/SkImage_Gpu.h ('k') | src/image/SkImage_Raster.cpp » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapCache.h" 8 #include "SkBitmapCache.h"
9 #include "SkImage_Gpu.h" 9 #include "SkImage_Gpu.h"
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return as_IB(fImage)->getROPixels(bitmap); 102 return as_IB(fImage)->getROPixels(bitmap);
103 } 103 }
104 104
105 private: 105 private:
106 const SkImage* fImage; 106 const SkImage* fImage;
107 GrTexture* fUnstretched; 107 GrTexture* fUnstretched;
108 108
109 typedef GrTextureMaker INHERITED; 109 typedef GrTextureMaker INHERITED;
110 }; 110 };
111 111
112 GrTexture* SkImage_Gpu::asTextureRef(GrContext* ctx, SkImageUsageType usage) con st { 112 GrTexture* SkImage_Gpu::asTextureRef(GrContext* ctx, const GrTextureParams& para ms) const {
113 return Texture_GrTextureMaker(this, fTexture).refCachedTexture(ctx, usage); 113 return Texture_GrTextureMaker(this, fTexture).refCachedTexture(ctx, params);
114 } 114 }
115 115
116 bool SkImage_Gpu::isOpaque() const { 116 bool SkImage_Gpu::isOpaque() const {
117 return GrPixelConfigIsOpaque(fTexture->config()) || fAlphaType == kOpaque_Sk AlphaType; 117 return GrPixelConfigIsOpaque(fTexture->config()) || fAlphaType == kOpaque_Sk AlphaType;
118 } 118 }
119 119
120 static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes) { 120 static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes) {
121 switch (info.colorType()) { 121 switch (info.colorType()) {
122 case kRGBA_8888_SkColorType: 122 case kRGBA_8888_SkColorType:
123 case kBGRA_8888_SkColorType: 123 case kBGRA_8888_SkColorType:
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 if (!dst) { 323 if (!dst) {
324 return nullptr; 324 return nullptr;
325 } 325 }
326 326
327 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); 327 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight);
328 const SkIPoint dstP = SkIPoint::Make(0, 0); 328 const SkIPoint dstP = SkIPoint::Make(0, 0);
329 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); 329 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp);
330 return dst; 330 return dst;
331 } 331 }
332 332
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698