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

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

Issue 338493005: stop using SkBitmap::Config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | src/gpu/SkGr.cpp » ('j') | src/images/SkImageDecoder_libwebp.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "effects/GrBicubicEffect.h" 10 #include "effects/GrBicubicEffect.h"
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTil eModeY() }; 1369 SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTil eModeY() };
1370 effect.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), tileModes)) ; 1370 effect.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), tileModes)) ;
1371 } else { 1371 } else {
1372 effect.reset(GrSimpleTextureEffect::Create(texture, SkMatrix::I(), param s)); 1372 effect.reset(GrSimpleTextureEffect::Create(texture, SkMatrix::I(), param s));
1373 } 1373 }
1374 1374
1375 // Construct a GrPaint by setting the bitmap texture as the first effect and then configuring 1375 // Construct a GrPaint by setting the bitmap texture as the first effect and then configuring
1376 // the rest from the SkPaint. 1376 // the rest from the SkPaint.
1377 GrPaint grPaint; 1377 GrPaint grPaint;
1378 grPaint.addColorEffect(effect); 1378 grPaint.addColorEffect(effect);
1379 bool alphaOnly = !(SkBitmap::kA8_Config == bitmap.config()); 1379 bool alphaOnly = !(kAlpha_8_SkColorType == bitmap.colorType());
1380 GrColor grColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) : 1380 GrColor grColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) :
1381 SkColor2GrColor(paint.getColor()); 1381 SkColor2GrColor(paint.getColor());
1382 SkPaint2GrPaintNoShader(this->context(), paint, grColor, false, &grPaint); 1382 SkPaint2GrPaintNoShader(this->context(), paint, grColor, false, &grPaint);
1383 1383
1384 fContext->drawRectToRect(grPaint, dstRect, paintRect, NULL); 1384 fContext->drawRectToRect(grPaint, dstRect, paintRect, NULL);
1385 } 1385 }
1386 1386
1387 static bool filter_texture(SkBaseDevice* device, GrContext* context, 1387 static bool filter_texture(SkBaseDevice* device, GrContext* context,
1388 GrTexture* texture, const SkImageFilter* filter, 1388 GrTexture* texture, const SkImageFilter* filter,
1389 int w, int h, const SkImageFilter::Context& ctx, 1389 int w, int h, const SkImageFilter::Context& ctx,
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict ure, i); 2002 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict ure, i);
2003 2003
2004 if (NULL != layer->getTexture()) { 2004 if (NULL != layer->getTexture()) {
2005 fContext->unlockScratchTexture(layer->getTexture()); 2005 fContext->unlockScratchTexture(layer->getTexture());
2006 layer->setTexture(NULL); 2006 layer->setTexture(NULL);
2007 } 2007 }
2008 } 2008 }
2009 2009
2010 return true; 2010 return true;
2011 } 2011 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/SkGr.cpp » ('j') | src/images/SkImageDecoder_libwebp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698