Lines Matching refs:SkSurface
42 static sk_sp<SkSurface> create_surface(SkAlphaType at = kPremul_SkAlphaType, in create_surface()
48 return SkSurface::MakeRaster(info); in create_surface()
50 static sk_sp<SkSurface> create_direct_surface(SkAlphaType at = kPremul_SkAlphaType, in create_direct_surface()
58 return SkSurface::MakeRasterDirectReleaseProc(info, storage, rowBytes, in create_direct_surface()
62 static sk_sp<SkSurface> create_gpu_surface(GrContext* context, SkAlphaType at = kPremul_SkAlphaType, in create_gpu_surface()
68 return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info); in create_gpu_surface()
70 static sk_sp<SkSurface> create_gpu_scratch_surface(GrContext* context, in create_gpu_scratch_surface()
77 return SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info); in create_gpu_scratch_surface()
82 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRaster(info)); in DEF_TEST()
83 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRasterDirect(info, nullptr, 0)); in DEF_TEST()
89 SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info)); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
101 auto surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 1, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
108 surf = SkSurface::MakeFromBackendTexture(context, backendTex, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
114 surf = SkSurface::MakeFromBackendTextureAsRenderTarget(context, backendTex, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
127 surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, kSampleCnt, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
135 surf = SkSurface::MakeFromBackendTexture(context, backendTex, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
152 surf = SkSurface::MakeFromBackendTextureAsRenderTarget(context, backendTex, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
177 surf = SkSurface::MakeFromBackendRenderTarget(context, backendRenderTarget, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
212 auto surf = SkSurface::MakeFromBackendTexture(context, backendTex, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
228 sk_sp<SkSurface>& surface, in test_canvas_peek()
269 static void test_snapshot_alphatype(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface, in test_snapshot_alphatype()
299 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess access) { in test_backend_texture_access_copy_on_write()
311 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess access) { in test_backend_rendertarget_access_copy_on_write()
324 const SkSurface::BackendHandleAccess accessModes[] = { in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
325 SkSurface::kFlushRead_BackendHandleAccess, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
326 SkSurface::kFlushWrite_BackendHandleAccess, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
327 SkSurface::kDiscardWrite_BackendHandleAccess, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
344 template<typename Type, Type(SkSurface::*func)(SkSurface::BackendHandleAccess)>
345 static void test_backend_unique_id(skiatest::Reporter* reporter, SkSurface* surface) { in test_backend_unique_id()
348 Type obj = (surface->*func)(SkSurface::kFlushRead_BackendHandleAccess); in test_backend_unique_id()
354 obj = (surface->*func)(SkSurface::kFlushWrite_BackendHandleAccess); in test_backend_unique_id()
360 obj = (surface->*func)(SkSurface::kDiscardWrite_BackendHandleAccess); in test_backend_unique_id()
373 test_backend_unique_id<GrBackendTexture, &SkSurface::getBackendTexture>(reporter, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
378 test_backend_unique_id<GrBackendRenderTarget, &SkSurface::getBackendRenderTarget>( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
385 static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface) { in test_copy_on_write()
453 SkSurface* surface) { in test_writable_after_snapshot_release()
473 SkSurface* surface1, in test_crbug263329()
474 SkSurface* surface2) { in test_crbug263329()
516 surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode); in DEF_TEST()
527 surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
534 static SkBudgeted is_budgeted(const sk_sp<SkSurface>& surf) { in is_budgeted()
553 auto surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), budgeted, info)); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
574 SkSurface* surface, in test_no_canvas1()
575 SkSurface::ContentChangeMode mode) { in test_no_canvas1()
580 SkSurface* surface, in test_no_canvas2()
581 SkSurface::ContentChangeMode mode) { in test_no_canvas2()
592 SkSurface::ContentChangeMode modes[] = in DEF_TEST()
593 { SkSurface::kDiscard_ContentChangeMode, SkSurface::kRetain_ContentChangeMode}; in DEF_TEST()
601 SkSurface::ContentChangeMode modes[] = in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
602 { SkSurface::kDiscard_ContentChangeMode, SkSurface::kRetain_ContentChangeMode}; in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
613 static void check_rowbytes_remain_consistent(SkSurface* surface, skiatest::Reporter* reporter) { in check_rowbytes_remain_consistent()
636 auto surf0(SkSurface::MakeRaster(info)); in DEF_TEST()
640 auto surf1(SkSurface::MakeRaster(info, 500, nullptr)); in DEF_TEST()
644 auto s = SkSurface::MakeRaster(info, 396, nullptr); // needs to be at least 400 in DEF_TEST()
646 s = SkSurface::MakeRaster(info, std::numeric_limits<size_t>::max(), nullptr); in DEF_TEST()
651 sk_sp<SkSurface> s(SkSurface::MakeRasterN32Premul(100, 100)); in DEF_TEST()
662 static sk_sp<SkSurface> create_gpu_surface_backend_texture( in create_gpu_surface_backend_texture()
696 sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(ctx, *outTexture, in create_gpu_surface_backend_texture()
707 static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target( in create_gpu_surface_backend_texture_as_render_target()
721 sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTextureAsRenderTarget( in create_gpu_surface_backend_texture_as_render_target()
732 static void test_surface_clear(skiatest::Reporter* reporter, sk_sp<SkSurface> surface, in test_surface_clear()
733 std::function<sk_sp<GrSurfaceContext>(SkSurface*)> grSurfaceGetter, in test_surface_clear()
779 std::function<sk_sp<GrSurfaceContext>(SkSurface*)> grSurfaceContextGetters[] = { in DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS()
780 [] (SkSurface* s){ in DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS()
783 [context] (SkSurface* s){ in DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS()
813 skiatest::Reporter* reporter, sk_sp<SkSurface> surface, uint32_t origColor) { in test_surface_draw_partially()
903 sk_sp<SkSurface> surface; in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
916 surface = SkSurface::MakeFromBackendTexture(ctx, backendTex, texOrigin, 1, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
927 surface = SkSurface::MakeFromBackendRenderTarget(ctx, backendRT, texOrigin, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1018 auto surf = SkSurface::MakeFromBackendTexture( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1054 surf = SkSurface::MakeFromBackendTexture( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1084 surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, ii, sampleCnt, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1093 static void test_overdraw_surface(skiatest::Reporter* r, SkSurface* surface) { in test_overdraw_surface()
1108 sk_sp<SkSurface> surface = create_surface(); in DEF_TEST()
1114 sk_sp<SkSurface> surface = create_gpu_surface(context); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1119 REPORTER_ASSERT(r, SkSurface::MakeNull(0, 0) == nullptr); in DEF_TEST()
1123 auto surf = SkSurface::MakeNull(w, h); in DEF_TEST()
1135 auto surf = SkSurface::MakeRaster(info, rowBytes, nullptr); in DEF_TEST()