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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: Address comments 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
« src/gpu/gl/GrGLGpu.cpp ('K') | « tests/ResourceCacheTest.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return; 113 return;
114 } 114 }
115 115
116 GrBackendObject textureHandle = dummySurface->asTexture()->getTextureHandle( ); 116 GrBackendObject textureHandle = dummySurface->asTexture()->getTextureHandle( );
117 117
118 GrBackendTextureDesc wrappedDesc; 118 GrBackendTextureDesc wrappedDesc;
119 wrappedDesc.fConfig = dummySurface->config(); 119 wrappedDesc.fConfig = dummySurface->config();
120 wrappedDesc.fWidth = dummySurface->width(); 120 wrappedDesc.fWidth = dummySurface->width();
121 wrappedDesc.fHeight = dummySurface->height(); 121 wrappedDesc.fHeight = dummySurface->height();
122 wrappedDesc.fOrigin = dummySurface->origin(); 122 wrappedDesc.fOrigin = dummySurface->origin();
123 wrappedDesc.fSampleCnt = dummySurface->asRenderTarget()->numSamples(); 123 wrappedDesc.fSampleCnt = dummySurface->asRenderTarget()->numColorSamples();
124 wrappedDesc.fFlags = kRenderTarget_GrBackendTextureFlag; 124 wrappedDesc.fFlags = kRenderTarget_GrBackendTextureFlag;
125 wrappedDesc.fTextureHandle = textureHandle; 125 wrappedDesc.fTextureHandle = textureHandle;
126 126
127 SkAutoTUnref<SkSurface> surface(SkSurface::NewWrappedRenderTarget(ctx, wrapp edDesc, NULL)); 127 SkAutoTUnref<SkSurface> surface(SkSurface::NewWrappedRenderTarget(ctx, wrapp edDesc, NULL));
128 REPORTER_ASSERT(reporter, surface); 128 REPORTER_ASSERT(reporter, surface);
129 } 129 }
130 #endif 130 #endif
131 131
132 132
133 static void test_image(skiatest::Reporter* reporter) { 133 static void test_image(skiatest::Reporter* reporter) {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 // Now lets jam new colors into our "external" texture, and see if the image s notice 736 // Now lets jam new colors into our "external" texture, and see if the image s notice
737 const SkPMColor expected1 = SkPreMultiplyColor(SK_ColorBLUE); 737 const SkPMColor expected1 = SkPreMultiplyColor(SK_ColorBLUE);
738 sk_memset32(storage, expected1, w * h); 738 sk_memset32(storage, expected1, w * h);
739 tex->writePixels(0, 0, w, h, kSkia8888_GrPixelConfig, storage, GrContext::kF lushWrites_PixelOp); 739 tex->writePixels(0, 0, w, h, kSkia8888_GrPixelConfig, storage, GrContext::kF lushWrites_PixelOp);
740 740
741 // We expect the ref'd image to see the new color, but cpy'd one should stil l see the old color 741 // We expect the ref'd image to see the new color, but cpy'd one should stil l see the old color
742 test_image_color(reporter, refImg, expected1); 742 test_image_color(reporter, refImg, expected1);
743 test_image_color(reporter, cpyImg, expected0); 743 test_image_color(reporter, cpyImg, expected0);
744 } 744 }
745 #endif 745 #endif
OLDNEW
« src/gpu/gl/GrGLGpu.cpp ('K') | « tests/ResourceCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698