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

Side by Side Diff: experimental/PdfViewer/pdf_viewer_main.cpp

Issue 319043005: Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add docs Created 6 years, 5 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
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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDoubl e(height), 161 setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDoubl e(height),
162 background); 162 background);
163 #endif 163 #endif
164 SkAutoTUnref<SkBaseDevice> device; 164 SkAutoTUnref<SkBaseDevice> device;
165 if (strcmp(FLAGS_config[0], "8888") == 0) { 165 if (strcmp(FLAGS_config[0], "8888") == 0) {
166 device.reset(SkNEW_ARGS(SkBitmapDevice, (bitmap))); 166 device.reset(SkNEW_ARGS(SkBitmapDevice, (bitmap)));
167 } 167 }
168 #if SK_SUPPORT_GPU 168 #if SK_SUPPORT_GPU
169 else if (strcmp(FLAGS_config[0], "gpu") == 0) { 169 else if (strcmp(FLAGS_config[0], "gpu") == 0) {
170 SkAutoTUnref<GrSurface> target; 170 SkAutoTUnref<GrSurface> target;
171 GrContext* gr = gContextFactory.get(GrContextFactory::kNative_GLCont extType); 171 GrContext* gr = gContextFactory.get(GrContextFactory::kNative_GLCont extType,
172 kNone_GrGLStandard);
172 if (gr) { 173 if (gr) {
173 // create a render target to back the device 174 // create a render target to back the device
174 GrTextureDesc desc; 175 GrTextureDesc desc;
175 desc.fConfig = kSkia8888_GrPixelConfig; 176 desc.fConfig = kSkia8888_GrPixelConfig;
176 desc.fFlags = kRenderTarget_GrTextureFlagBit; 177 desc.fFlags = kRenderTarget_GrTextureFlagBit;
177 desc.fWidth = SkScalarCeilToInt(width); 178 desc.fWidth = SkScalarCeilToInt(width);
178 desc.fHeight = SkScalarCeilToInt(height); 179 desc.fHeight = SkScalarCeilToInt(height);
179 desc.fSampleCnt = 0; 180 desc.fSampleCnt = 0;
180 target.reset(gr->createUncachedTexture(desc, NULL, 0)); 181 target.reset(gr->createUncachedTexture(desc, NULL, 0));
181 } 182 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 341 }
341 342
342 return 0; 343 return 0;
343 } 344 }
344 345
345 #if !defined SK_BUILD_FOR_IOS 346 #if !defined SK_BUILD_FOR_IOS
346 int main(int argc, char * const argv[]) { 347 int main(int argc, char * const argv[]) {
347 return tool_main(argc, (char**) argv); 348 return tool_main(argc, (char**) argv);
348 } 349 }
349 #endif 350 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698