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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 1211123004: Revert of Return GrGLContext from GrTestTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 GrTestTarget tt; 110 GrTestTarget tt;
111 ctx->getTestTarget(&tt); 111 ctx->getTestTarget(&tt);
112 if (!tt.target()) { 112 if (!tt.target()) {
113 SkDEBUGFAIL("Couldn't get Gr test target."); 113 SkDEBUGFAIL("Couldn't get Gr test target.");
114 return; 114 return;
115 } 115 }
116 116
117 // We currently have only implemented the texture uploads for GL. 117 // We currently have only implemented the texture uploads for GL.
118 const GrGLInterface* gl = tt.glContext()->interface(); 118 const GrGLInterface* gl = tt.glInterface();
119 if (!gl) { 119 if (!gl) {
120 return; 120 return;
121 } 121 }
122 122
123 // Test the wrapped factory for SkSurface by creating a texture using GL and then wrap it in 123 // Test the wrapped factory for SkSurface by creating a texture using GL and then wrap it in
124 // a SkSurface. 124 // a SkSurface.
125 GrGLuint texID; 125 GrGLuint texID;
126 static const int kW = 100; 126 static const int kW = 100;
127 static const int kH = 100; 127 static const int kH = 100;
128 static const uint32_t kOrigColor = 0xFFAABBCC; 128 static const uint32_t kOrigColor = 0xFFAABBCC;
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 // We expect the ref'd image to see the new color, but cpy'd one should stil l see the old color 891 // We expect the ref'd image to see the new color, but cpy'd one should stil l see the old color
892 test_image_color(reporter, refImg, expected1); 892 test_image_color(reporter, refImg, expected1);
893 test_image_color(reporter, cpyImg, expected0); 893 test_image_color(reporter, cpyImg, expected0);
894 894
895 // Now exercise the release proc 895 // Now exercise the release proc
896 REPORTER_ASSERT(reporter, !releaseCtx.fIsReleased); 896 REPORTER_ASSERT(reporter, !releaseCtx.fIsReleased);
897 refImg.reset(NULL); // force a release of the image 897 refImg.reset(NULL); // force a release of the image
898 REPORTER_ASSERT(reporter, releaseCtx.fIsReleased); 898 REPORTER_ASSERT(reporter, releaseCtx.fIsReleased);
899 } 899 }
900 #endif 900 #endif
OLDNEW
« no previous file with comments | « tests/ResourceCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698