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

Side by Side Diff: src/gpu/GrImageIDTextureAdjuster.cpp

Issue 2250403003: Add alpha type to texture producer (Closed) Base URL: https://skia.googlesource.com/skia.git@image-alpha-type
Patch Set: Created 4 years, 4 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/gpu/GrImageIDTextureAdjuster.h ('k') | src/gpu/GrTextureParamsAdjuster.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "GrImageIDTextureAdjuster.h" 8 #include "GrImageIDTextureAdjuster.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 void GrBitmapTextureMaker::makeCopyKey(const CopyParams& copyParams, GrUniqueKey * copyKey) { 55 void GrBitmapTextureMaker::makeCopyKey(const CopyParams& copyParams, GrUniqueKey * copyKey) {
56 if (fOriginalKey.isValid()) { 56 if (fOriginalKey.isValid()) {
57 MakeCopyKeyFromOrigKey(fOriginalKey, copyParams, copyKey); 57 MakeCopyKeyFromOrigKey(fOriginalKey, copyParams, copyKey);
58 } 58 }
59 } 59 }
60 60
61 void GrBitmapTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) { 61 void GrBitmapTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) {
62 GrInstallBitmapUniqueKeyInvalidator(copyKey, fBitmap.pixelRef()); 62 GrInstallBitmapUniqueKeyInvalidator(copyKey, fBitmap.pixelRef());
63 } 63 }
64 64
65 SkAlphaType GrBitmapTextureMaker::alphaType() const {
66 return fBitmap.alphaType();
67 }
68
65 SkColorSpace* GrBitmapTextureMaker::getColorSpace() { 69 SkColorSpace* GrBitmapTextureMaker::getColorSpace() {
66 return fBitmap.colorSpace(); 70 return fBitmap.colorSpace();
67 } 71 }
68 72
69 ////////////////////////////////////////////////////////////////////////////// 73 //////////////////////////////////////////////////////////////////////////////
70 static bool cacher_is_alpha_only(const SkImageCacherator& cacher) { 74 static bool cacher_is_alpha_only(const SkImageCacherator& cacher) {
71 return kAlpha_8_SkColorType == cacher.info().colorType(); 75 return kAlpha_8_SkColorType == cacher.info().colorType();
72 } 76 }
73 GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator* cacher, 77 GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator* cacher,
74 const SkImage* client, SkImage::Caching Hint chint) 78 const SkImage* client, SkImage::Caching Hint chint)
(...skipping 19 matching lines...) Expand all
94 MakeCopyKeyFromOrigKey(fOriginalKey, stretch, paramsCopyKey); 98 MakeCopyKeyFromOrigKey(fOriginalKey, stretch, paramsCopyKey);
95 } 99 }
96 } 100 }
97 101
98 void GrImageTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) { 102 void GrImageTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) {
99 if (fClient) { 103 if (fClient) {
100 as_IB(fClient)->notifyAddedToCache(); 104 as_IB(fClient)->notifyAddedToCache();
101 } 105 }
102 } 106 }
103 107
108 SkAlphaType GrImageTextureMaker::alphaType() const {
109 return fCacher->info().alphaType();
110 }
111
104 SkColorSpace* GrImageTextureMaker::getColorSpace() { 112 SkColorSpace* GrImageTextureMaker::getColorSpace() {
105 return fCacher->info().colorSpace(); 113 return fCacher->info().colorSpace();
106 } 114 }
OLDNEW
« no previous file with comments | « src/gpu/GrImageIDTextureAdjuster.h ('k') | src/gpu/GrTextureParamsAdjuster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698