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

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

Issue 2072813002: Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/sk_app/android/GLWindowContext_android.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 this->setBuffersGeometry(); 61 this->setBuffersGeometry();
62 } 62 }
63 63
64 sk_sp<SkSurface> RasterWindowContext_android::getBackbufferSurface() { 64 sk_sp<SkSurface> RasterWindowContext_android::getBackbufferSurface() {
65 if (nullptr == fBackbufferSurface) { 65 if (nullptr == fBackbufferSurface) {
66 ANativeWindow_lock(fNativeWindow, &fBuffer, &fBounds); 66 ANativeWindow_lock(fNativeWindow, &fBuffer, &fBounds);
67 const int bytePerPixel = fBuffer.format == WINDOW_FORMAT_RGB_565 ? 2 : 4 ; 67 const int bytePerPixel = fBuffer.format == WINDOW_FORMAT_RGB_565 ? 2 : 4 ;
68 SkImageInfo info = SkImageInfo::Make(fWidth, fHeight, 68 SkImageInfo info = SkImageInfo::Make(fWidth, fHeight,
69 fDisplayParams.fColorType, 69 fDisplayParams.fColorType,
70 kOpaque_SkAlphaType, 70 kOpaque_SkAlphaType,
71 fDisplayParams.fColorSpace); 71 fDisplayParams.fProfileType);
72 fBackbufferSurface = SkSurface::MakeRasterDirect( 72 fBackbufferSurface = SkSurface::MakeRasterDirect(
73 info, fBuffer.bits, fBuffer.stride * bytePerPixel, nullptr); 73 info, fBuffer.bits, fBuffer.stride * bytePerPixel, nullptr);
74 } 74 }
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/sk_app/android/GLWindowContext_android.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698