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

Unified Diff: src/gpu/SkGr.cpp

Issue 1164443002: Revert of Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/gpu/SkGpuDevice.cpp ('k') | tests/GrDrawTargetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 70c81f930a8e54b0482aece09b6bcc44b2a2ea6e..decb35848efa73f162c57937aa81fd0e3aab432f 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -7,7 +7,6 @@
#include "SkGr.h"
-#include "GrCaps.h"
#include "GrDrawContext.h"
#include "GrXferProcessor.h"
#include "SkColorFilter.h"
@@ -97,7 +96,7 @@
static Stretch get_stretch_type(const GrContext* ctx, int width, int height,
const GrTextureParams* params) {
if (params && params->isTiled()) {
- if (!ctx->caps()->npotTextureTileSupport() && (!SkIsPow2(width) || !SkIsPow2(height))) {
+ if (!ctx->npotTextureTileSupport() && (!SkIsPow2(width) || !SkIsPow2(height))) {
switch(params->filterMode()) {
case GrTextureParams::kNone_FilterMode:
return kNearest_Stretch;
@@ -199,7 +198,6 @@
GrContext* context = inputTexture->getContext();
SkASSERT(context);
- const GrCaps* caps = context->caps();
// Either it's a cache miss or the original wasn't cached to begin with.
GrSurfaceDesc rtDesc = inputTexture->desc();
@@ -210,18 +208,18 @@
// If the config isn't renderable try converting to either A8 or an 32 bit config. Otherwise,
// fail.
- if (!caps->isConfigRenderable(rtDesc.fConfig, false)) {
+ if (!context->isConfigRenderable(rtDesc.fConfig, false)) {
if (GrPixelConfigIsAlphaOnly(rtDesc.fConfig)) {
- if (caps->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
+ if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
rtDesc.fConfig = kAlpha_8_GrPixelConfig;
- } else if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) {
+ } else if (context->isConfigRenderable(kSkia8888_GrPixelConfig, false)) {
rtDesc.fConfig = kSkia8888_GrPixelConfig;
} else {
return NULL;
}
} else if (kRGB_GrColorComponentFlags ==
(kRGB_GrColorComponentFlags & GrPixelConfigComponentMask(rtDesc.fConfig))) {
- if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) {
+ if (context->isConfigRenderable(kSkia8888_GrPixelConfig, false)) {
rtDesc.fConfig = kSkia8888_GrPixelConfig;
} else {
return NULL;
@@ -425,10 +423,9 @@
GrSurfaceDesc desc;
generate_bitmap_texture_desc(*bitmap, &desc);
- const GrCaps* caps = ctx->caps();
if (kIndex_8_SkColorType == bitmap->colorType()) {
- if (caps->isConfigTexturable(kIndex_8_GrPixelConfig)) {
+ if (ctx->isConfigTexturable(kIndex_8_GrPixelConfig)) {
size_t imageSize = GrCompressedFormatDataSize(kIndex_8_GrPixelConfig,
bitmap->width(), bitmap->height());
SkAutoMalloc storage(imageSize);
@@ -450,7 +447,7 @@
#ifndef SK_IGNORE_ETC1_SUPPORT
// Make sure that the underlying device supports ETC1 textures before we go ahead
// and check the data.
- else if (caps->isConfigTexturable(kETC1_GrPixelConfig)
+ else if (ctx->isConfigTexturable(kETC1_GrPixelConfig)
// If the bitmap had compressed data and was then uncompressed, it'll still return
// compressed data on 'refEncodedData' and upload it. Probably not good, since if
// the bitmap has available pixels, then they might not be what the decompressed
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | tests/GrDrawTargetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698