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

Side by Side Diff: tests/RectangleTextureTest.cpp

Issue 1815823002: Move SkGLContext and some GrGLInterface implementations to skgputest module (Closed) Base URL: https://chromium.googlesource.com/skia.git@debugobject
Patch Set: fix windows and android? Created 4 years, 8 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/ImageTest.cpp ('k') | tests/Test.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 "Test.h" 8 #include "Test.h"
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrContext.h" 10 #include "GrContext.h"
11 #include "GrDrawContext.h" 11 #include "GrDrawContext.h"
12 #include "gl/GrGLGpu.h" 12 #include "gl/GrGLGpu.h"
13 #include "gl/GrGLUtil.h" 13 #include "gl/GrGLUtil.h"
14 #include "gl/SkGLContext.h" 14 #include "gl/GLContext.h"
15 15
16 static void test_read_pixels(skiatest::Reporter* reporter, GrContext* context, 16 static void test_read_pixels(skiatest::Reporter* reporter, GrContext* context,
17 GrTexture* rectangleTexture, uint32_t expectedPixel Values[]) { 17 GrTexture* rectangleTexture, uint32_t expectedPixel Values[]) {
18 int pixelCnt = rectangleTexture->width() * rectangleTexture->height(); 18 int pixelCnt = rectangleTexture->width() * rectangleTexture->height();
19 SkAutoTMalloc<uint32_t> pixels(pixelCnt); 19 SkAutoTMalloc<uint32_t> pixels(pixelCnt);
20 memset(pixels.get(), 0, sizeof(uint32_t)*pixelCnt); 20 memset(pixels.get(), 0, sizeof(uint32_t)*pixelCnt);
21 bool read = rectangleTexture->readPixels(0, 0, rectangleTexture->width(), 21 bool read = rectangleTexture->readPixels(0, 0, rectangleTexture->width(),
22 rectangleTexture->height(), kRGBA_88 88_GrPixelConfig, 22 rectangleTexture->height(), kRGBA_88 88_GrPixelConfig,
23 pixels.get()); 23 pixels.get());
24 if (!read) { 24 if (!read) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 test_write_pixels(reporter, context, rectangleTexture); 199 test_write_pixels(reporter, context, rectangleTexture);
200 200
201 test_clear(reporter, context, rectangleTexture); 201 test_clear(reporter, context, rectangleTexture);
202 202
203 GR_GL_CALL(glContext->gl(), DeleteTextures(1, &rectTexID)); 203 GR_GL_CALL(glContext->gl(), DeleteTextures(1, &rectTexID));
204 } 204 }
205 } 205 }
206 206
207 #endif 207 #endif
OLDNEW
« no previous file with comments | « tests/ImageTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698