Lines Matching refs:SkSurface
46 static sk_sp<SkSurface> create_surface(SkAlphaType at = kPremul_SkAlphaType, in create_surface()
52 return SkSurface::MakeRaster(info); in create_surface()
54 static sk_sp<SkSurface> create_direct_surface(SkAlphaType at = kPremul_SkAlphaType, in create_direct_surface()
62 return SkSurface::MakeRasterDirectReleaseProc(info, storage, rowBytes, in create_direct_surface()
66 static sk_sp<SkSurface> create_gpu_surface(GrRecordingContext* rContext, in create_gpu_surface()
73 return SkSurface::MakeRenderTarget(rContext, SkBudgeted::kNo, info); in create_gpu_surface()
75 static sk_sp<SkSurface> create_gpu_scratch_surface(GrRecordingContext* rContext, in create_gpu_scratch_surface()
82 return SkSurface::MakeRenderTarget(rContext, SkBudgeted::kYes, info); in create_gpu_scratch_surface()
87 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRaster(info)); in DEF_TEST()
88 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRasterDirect(info, nullptr, 0)); in DEF_TEST()
94 SkSurface::MakeRenderTarget(ctxInfo.directContext(), SkBudgeted::kNo, info)); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
108 auto surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 1, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
126 auto surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, kSampleCnt, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
215 sk_sp<SkSurface>& surface, in test_canvas_peek()
256 static void test_snapshot_alphatype(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface, in test_snapshot_alphatype()
286 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess access) { in test_backend_texture_access_copy_on_write()
298 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess access) { in test_backend_rendertarget_access_copy_on_write()
311 const SkSurface::BackendHandleAccess accessModes[] = { in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
312 SkSurface::kFlushRead_BackendHandleAccess, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
313 SkSurface::kFlushWrite_BackendHandleAccess, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
314 SkSurface::kDiscardWrite_BackendHandleAccess, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
331 template<typename Type, Type(SkSurface::*func)(SkSurface::BackendHandleAccess)>
332 static void test_backend_unique_id(skiatest::Reporter* reporter, SkSurface* surface) { in test_backend_unique_id()
335 Type obj = (surface->*func)(SkSurface::kFlushRead_BackendHandleAccess); in test_backend_unique_id()
341 obj = (surface->*func)(SkSurface::kFlushWrite_BackendHandleAccess); in test_backend_unique_id()
347 obj = (surface->*func)(SkSurface::kDiscardWrite_BackendHandleAccess); in test_backend_unique_id()
360 test_backend_unique_id<GrBackendTexture, &SkSurface::getBackendTexture>(reporter, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
365 test_backend_unique_id<GrBackendRenderTarget, &SkSurface::getBackendRenderTarget>( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
374 sk_sp<SkSurface> surface = create_gpu_surface(direct, kPremul_SkAlphaType, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
389 sk_sp<SkSurface> surface = create_gpu_surface(dContext, kPremul_SkAlphaType, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
395 surface->getBackendRenderTarget(SkSurface::kFlushRead_BackendHandleAccess); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
398 surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
405 beRT = surface->getBackendRenderTarget(SkSurface::kFlushRead_BackendHandleAccess); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
407 beTex = surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
412 static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface) { in test_copy_on_write()
479 SkSurface* surface) { in test_writable_after_snapshot_release()
499 SkSurface* surface1, in test_crbug263329()
500 SkSurface* surface2) { in test_crbug263329()
549 surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode); in DEF_TEST()
560 surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
567 static SkBudgeted is_budgeted(const sk_sp<SkSurface>& surf) { in is_budgeted()
582 auto surface(SkSurface::MakeRenderTarget(dContext, budgeted, info)); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
603 SkSurface* surface, in test_no_canvas1()
604 SkSurface::ContentChangeMode mode) { in test_no_canvas1()
609 SkSurface* surface, in test_no_canvas2()
610 SkSurface::ContentChangeMode mode) { in test_no_canvas2()
621 SkSurface::ContentChangeMode modes[] = in DEF_TEST()
622 { SkSurface::kDiscard_ContentChangeMode, SkSurface::kRetain_ContentChangeMode}; in DEF_TEST()
630 SkSurface::ContentChangeMode modes[] = in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
631 { SkSurface::kDiscard_ContentChangeMode, SkSurface::kRetain_ContentChangeMode}; in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
642 static void check_rowbytes_remain_consistent(SkSurface* surface, skiatest::Reporter* reporter) { in check_rowbytes_remain_consistent()
665 auto surf0(SkSurface::MakeRaster(info)); in DEF_TEST()
669 auto surf1(SkSurface::MakeRaster(info, 500, nullptr)); in DEF_TEST()
673 auto s = SkSurface::MakeRaster(info, 396, nullptr); // needs to be at least 400 in DEF_TEST()
675 s = SkSurface::MakeRaster(info, std::numeric_limits<size_t>::max(), nullptr); in DEF_TEST()
680 sk_sp<SkSurface> s(SkSurface::MakeRasterN32Premul(100, 100)); in DEF_TEST()
691 static sk_sp<SkSurface> create_gpu_surface_backend_texture(GrDirectContext* dContext, in create_gpu_surface_backend_texture()
729 static bool supports_readpixels(const GrCaps* caps, SkSurface* surface) { in supports_readpixels()
738 static sk_sp<SkSurface> create_gpu_surface_backend_render_target(GrDirectContext* dContext, in create_gpu_surface_backend_render_target()
792 auto makeImageSurfaceContext = [dContext](SkSurface* surface) { in DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS()
839 skiatest::Reporter* reporter, sk_sp<SkSurface> surface, SkColor origColor) { in test_surface_draw_partially()
926 sk_sp<SkSurface> surface; in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
940 surface = SkSurface::MakeFromBackendTexture( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
956 surface = SkSurface::MakeFromBackendRenderTarget(ctx, backendRT, texOrigin, in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1039 auto surf = SkSurface::MakeFromBackendTexture( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1075 surf = SkSurface::MakeFromBackendTexture( in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1105 surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, ii, sampleCnt, nullptr); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1114 static void test_overdraw_surface(skiatest::Reporter* r, SkSurface* surface) { in test_overdraw_surface()
1129 sk_sp<SkSurface> surface = create_surface(); in DEF_TEST()
1135 sk_sp<SkSurface> surface = create_gpu_surface(context); in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
1140 REPORTER_ASSERT(r, SkSurface::MakeNull(0, 0) == nullptr); in DEF_TEST()
1144 auto surf = SkSurface::MakeNull(w, h); in DEF_TEST()
1156 auto surf = SkSurface::MakeRaster(info, rowBytes, nullptr); in DEF_TEST()