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

Side by Side Diff: tools/viewer/sk_app/android/RasterWindowContext_android.cpp

Issue 2058753002: Display JPGs in Viewer with Split Screen and ColorSpaceXform (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Unmerge Created 4 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 | « tools/viewer/Viewer.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 /* 2 /*
3 * Copyright 2016 Google Inc. 3 * Copyright 2016 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "RasterWindowContext_android.h" 9 #include "RasterWindowContext_android.h"
10 10
(...skipping 18 matching lines...) Expand all
29 fDisplayParams = params; 29 fDisplayParams = params;
30 ContextPlatformData_android* androidPlatformData = 30 ContextPlatformData_android* androidPlatformData =
31 reinterpret_cast<ContextPlatformData_android*>(platformData); 31 reinterpret_cast<ContextPlatformData_android*>(platformData);
32 fNativeWindow = androidPlatformData->fNativeWindow; 32 fNativeWindow = androidPlatformData->fNativeWindow;
33 fWidth = ANativeWindow_getWidth(fNativeWindow); 33 fWidth = ANativeWindow_getWidth(fNativeWindow);
34 fHeight = ANativeWindow_getHeight(fNativeWindow); 34 fHeight = ANativeWindow_getHeight(fNativeWindow);
35 this->setBuffersGeometry(); 35 this->setBuffersGeometry();
36 } 36 }
37 37
38 void RasterWindowContext_android::setBuffersGeometry() { 38 void RasterWindowContext_android::setBuffersGeometry() {
39 int32_t format; 39 int32_t format = 0;
40 switch(fDisplayParams.fColorType) { 40 switch(fDisplayParams.fColorType) {
41 case kRGBA_8888_SkColorType: 41 case kRGBA_8888_SkColorType:
42 format = WINDOW_FORMAT_RGBA_8888; 42 format = WINDOW_FORMAT_RGBA_8888;
43 break; 43 break;
44 case kRGB_565_SkColorType: 44 case kRGB_565_SkColorType:
45 format = WINDOW_FORMAT_RGB_565; 45 format = WINDOW_FORMAT_RGB_565;
46 break; 46 break;
47 default: 47 default:
48 SkDEBUGFAIL("Unsupported Android color type"); 48 SK_ABORT("Unsupported Android color type");
49 } 49 }
50 ANativeWindow_setBuffersGeometry(fNativeWindow, fWidth, fHeight, format); 50 ANativeWindow_setBuffersGeometry(fNativeWindow, fWidth, fHeight, format);
51 } 51 }
52 52
53 void RasterWindowContext_android::setDisplayParams(const DisplayParams& params) { 53 void RasterWindowContext_android::setDisplayParams(const DisplayParams& params) {
54 fDisplayParams = params; 54 fDisplayParams = params;
55 this->setBuffersGeometry(); 55 this->setBuffersGeometry();
56 } 56 }
57 57
58 void RasterWindowContext_android::resize(uint32_t w, uint32_t h) { 58 void RasterWindowContext_android::resize(uint32_t w, uint32_t h) {
(...skipping 16 matching lines...) Expand all
75 return fBackbufferSurface; 75 return fBackbufferSurface;
76 } 76 }
77 77
78 78
79 void RasterWindowContext_android::swapBuffers() { 79 void RasterWindowContext_android::swapBuffers() {
80 ANativeWindow_unlockAndPost(fNativeWindow); 80 ANativeWindow_unlockAndPost(fNativeWindow);
81 fBackbufferSurface.reset(nullptr); 81 fBackbufferSurface.reset(nullptr);
82 } 82 }
83 83
84 } // namespace sk_app 84 } // namespace sk_app
OLDNEW
« no previous file with comments | « tools/viewer/Viewer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698