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

Unified Diff: tests/SurfaceTest.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/SpecialImageTest.cpp ('k') | tests/TextBlobCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SurfaceTest.cpp
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 7449f211b560c1066667735a84d870341aed61d2..41fef617bca9e37669a26dc5716833ff0dde5300 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -54,7 +54,7 @@
if (requestedInfo) {
*requestedInfo = info;
}
- return SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info, 0, nullptr);
+ return SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info, 0, nullptr);
}
static SkSurface* create_gpu_scratch_surface(GrContext* context,
SkAlphaType at = kPremul_SkAlphaType,
@@ -63,7 +63,7 @@
if (requestedInfo) {
*requestedInfo = info;
}
- return SkSurface::NewRenderTarget(context, SkBudgeted::kYes, info, 0, nullptr);
+ return SkSurface::NewRenderTarget(context, SkSurface::kYes_Budgeted, info, 0, nullptr);
}
#endif
@@ -77,7 +77,7 @@
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, context) {
const SkImageInfo info = SkImageInfo::Make(0, 0, kN32_SkColorType, kPremul_SkAlphaType);
REPORTER_ASSERT(reporter, nullptr ==
- SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info, 0, nullptr));
+ SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info, 0, nullptr));
}
#endif
@@ -340,7 +340,7 @@
std::function<intptr_t(SkSurface*)> surfaceBackingStore) {
std::function<intptr_t(SkImage*)> ibs = imageBackingStore;
std::function<intptr_t(SkSurface*)> sbs = surfaceBackingStore;
- static const SkBudgeted kB = SkBudgeted::kNo;
+ static const SkSurface::Budgeted kB = SkSurface::kNo_Budgeted;
{
SkAutoTUnref<SkImage> image(surface->newImageSnapshot(kB, SkSurface::kYes_ForceUnique));
REPORTER_ASSERT(reporter, !same_image_surf(image, surface, ibs, sbs));
@@ -699,18 +699,22 @@
#include "SkImage_Gpu.h"
#include "SkSurface_Gpu.h"
-static SkBudgeted is_budgeted(SkSurface* surf) {
- return ((SkSurface_Gpu*)surf)->getDevice()->accessRenderTarget()->resourcePriv().isBudgeted();
-}
-
-static SkBudgeted is_budgeted(SkImage* image) {
- return ((SkImage_Gpu*)image)->getTexture()->resourcePriv().isBudgeted();
+static SkSurface::Budgeted is_budgeted(SkSurface* surf) {
+ return ((SkSurface_Gpu*)surf)->getDevice()->accessRenderTarget()->resourcePriv().isBudgeted() ?
+ SkSurface::kYes_Budgeted : SkSurface::kNo_Budgeted;
+}
+
+static SkSurface::Budgeted is_budgeted(SkImage* image) {
+ return ((SkImage_Gpu*)image)->getTexture()->resourcePriv().isBudgeted() ?
+ SkSurface::kYes_Budgeted : SkSurface::kNo_Budgeted;
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, context) {
SkImageInfo info = SkImageInfo::MakeN32Premul(8,8);
- for (auto sbudgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {
- for (auto ibudgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {
+ for (int i = 0; i < 2; ++i) {
+ SkSurface::Budgeted sbudgeted = i ? SkSurface::kYes_Budgeted : SkSurface::kNo_Budgeted;
+ for (int j = 0; j < 2; ++j) {
+ SkSurface::Budgeted ibudgeted = j ? SkSurface::kYes_Budgeted : SkSurface::kNo_Budgeted;
SkAutoTUnref<SkSurface>
surface(SkSurface::NewRenderTarget(context, sbudgeted, info, 0));
SkASSERT(surface);
« no previous file with comments | « tests/SpecialImageTest.cpp ('k') | tests/TextBlobCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698