OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkConfig8888.h" | 10 #include "SkConfig8888.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 DEF_TEST(PremulAlphaRoundTrip, reporter) { | 101 DEF_TEST(PremulAlphaRoundTrip, reporter) { |
102 const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256); | 102 const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256); |
103 SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 103 SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
104 SkAutoTUnref<SkBaseDevice> device(SkBitmapDevice::Create(info, props)); | 104 SkAutoTUnref<SkBaseDevice> device(SkBitmapDevice::Create(info, props)); |
105 test_premul_alpha_roundtrip(reporter, device); | 105 test_premul_alpha_roundtrip(reporter, device); |
106 } | 106 } |
107 #if SK_SUPPORT_GPU | 107 #if SK_SUPPORT_GPU |
108 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(PremulAlphaRoundTrip_Gpu, reporter, ctxInf
o) { | 108 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PremulAlphaRoundTrip_Gpu, reporter, ctxInfo)
{ |
109 const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256); | 109 const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256); |
110 SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 110 SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
111 SkAutoTUnref<SkBaseDevice> device( | 111 SkAutoTUnref<SkBaseDevice> device( |
112 SkGpuDevice::Create(ctxInfo.fGrContext, SkBudgeted::kNo, info, 0, &props
, | 112 SkGpuDevice::Create(ctxInfo.fGrContext, SkBudgeted::kNo, info, 0, &props
, |
113 SkGpuDevice::kUninit_InitContents)); | 113 SkGpuDevice::kUninit_InitContents)); |
114 test_premul_alpha_roundtrip(reporter, device); | 114 test_premul_alpha_roundtrip(reporter, device); |
115 } | 115 } |
116 #endif | 116 #endif |
OLD | NEW |