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

Side by Side Diff: tests/GrPorterDuffTest.cpp

Issue 1149773005: Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init caps in the right place Created 5 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 | « tests/GrDrawTargetTest.cpp ('k') | tests/ResourceCacheTest.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 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 "SkXfermode.h" 8 #include "SkXfermode.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 GrContextOptions opts; 942 GrContextOptions opts;
943 opts.fSuppressDualSourceBlending = true; 943 opts.fSuppressDualSourceBlending = true;
944 GrContextFactory factory(opts); 944 GrContextFactory factory(opts);
945 factory.get(GrContextFactory::kNull_GLContextType); 945 factory.get(GrContextFactory::kNull_GLContextType);
946 GrContext* ctx = factory.get(GrContextFactory::kNull_GLContextType); 946 GrContext* ctx = factory.get(GrContextFactory::kNull_GLContextType);
947 if (!ctx) { 947 if (!ctx) {
948 SkFAIL("Failed to create null context without ARB_blend_func_extended.") ; 948 SkFAIL("Failed to create null context without ARB_blend_func_extended.") ;
949 return; 949 return;
950 } 950 }
951 951
952 const GrCaps& caps = *ctx->getGpu()->caps(); 952 const GrCaps& caps = *ctx->caps();
953 if (caps.shaderCaps()->dualSourceBlendingSupport()) { 953 if (caps.shaderCaps()->dualSourceBlendingSupport()) {
954 SkFAIL("Null context failed to honor request for no ARB_blend_func_exten ded."); 954 SkFAIL("Null context failed to honor request for no ARB_blend_func_exten ded.");
955 return; 955 return;
956 } 956 }
957 957
958 GrBackendTextureDesc fakeDesc; 958 GrBackendTextureDesc fakeDesc;
959 fakeDesc.fConfig = kRGBA_8888_GrPixelConfig; 959 fakeDesc.fConfig = kRGBA_8888_GrPixelConfig;
960 fakeDesc.fWidth = fakeDesc.fHeight = 100; 960 fakeDesc.fWidth = fakeDesc.fHeight = 100;
961 fakeDesc.fTextureHandle = 1; 961 fakeDesc.fTextureHandle = 1;
962 SkAutoTUnref<GrTexture> fakeTexture(ctx->resourceProvider()->wrapBackendText ure(fakeDesc)); 962 SkAutoTUnref<GrTexture> fakeTexture(ctx->resourceProvider()->wrapBackendText ure(fakeDesc));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 TEST_ASSERT(!xp->hasSecondaryOutput()); 1002 TEST_ASSERT(!xp->hasSecondaryOutput());
1003 xp->getOptimizations(colorPOI, covPOI, false, 0, caps); 1003 xp->getOptimizations(colorPOI, covPOI, false, 0, caps);
1004 TEST_ASSERT(!xp->hasSecondaryOutput()); 1004 TEST_ASSERT(!xp->hasSecondaryOutput());
1005 } 1005 }
1006 } 1006 }
1007 } 1007 }
1008 } 1008 }
1009 1009
1010 #endif 1010 #endif
1011 1011
OLDNEW
« no previous file with comments | « tests/GrDrawTargetTest.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698