aboutsummaryrefslogtreecommitdiffhomepage
path: root/example/HelloWorld.cpp
Commit message (Collapse)AuthorAge
* Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | sample counts in GPU backend."""""" This reverts commit 3a2cc2c2ec124de36d2544b2a523ef1dd317ca32. Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab Reviewed-on: https://skia-review.googlesource.com/103181 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | counts in GPU backend.""""" This reverts commit 5bb82cbecd740d21b92e8d2944280ab6eb6af7a6. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""" > > This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. > > Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" > > > Bug: skia: > Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 > Reviewed-on: https://skia-review.googlesource.com/102940 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/103220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU ↵Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | backend."""" This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" Bug: skia: Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 Reviewed-on: https://skia-review.googlesource.com/102940 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | | | | | | This reverts commit d0d7270fcc32546005b8e847df516cb11592cd30. Revert "More sample count cleanup:" This reverts commit d653cac70ed17983125ceed053138c09f1401846. Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types" This reverts commit 85ae7159c9c8a9186a4c7e74304eabb35bca9a79. Need to understand NVPR perf changes before relanding Change-Id: I0db075fb42438ef2a1f9885df184dce52892ac4b Reviewed-on: https://skia-review.googlesource.com/102780 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Redefine the meaning of sample counts in GPU backend.""Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | Fixes gpu config default samples to be 1 and updates config parsing test accordingly. This reverts commit c1ce2f7966babaae0deb150f93f1227ee5af9285. Bug: skia: Change-Id: I456973b1f52ced85a2011ea10fc49449bfc5846f Reviewed-on: https://skia-review.googlesource.com/102147 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Redefine the meaning of sample counts in GPU backend."Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48825b11ad25c98b9a4884d5cc0edd4e290c4409. Reason for revert: nanobench Original change's description: > Redefine the meaning of sample counts in GPU backend. > > Old: 0 -> nonMSAA > 1+ -> MSAA > > New: > 0 -> error/unsupported > 1 -> nonMSAA > 2+ -> MSAA > > We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility: > > 1) SkSurface factories > 2) GrBackendRenderTarget constructors > 3) GrCaps::getSampleCnt()'s requestedCount parameter > > However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally. > > This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case. > > > Bug: skia: > Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33 > Reviewed-on: https://skia-review.googlesource.com/101560 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Ic257619a8a5ee9ac15419ecf10259e42daed7f82 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/102662 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Redefine the meaning of sample counts in GPU backend.Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | Old: 0 -> nonMSAA 1+ -> MSAA New: 0 -> error/unsupported 1 -> nonMSAA 2+ -> MSAA We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility: 1) SkSurface factories 2) GrBackendRenderTarget constructors 3) GrCaps::getSampleCnt()'s requestedCount parameter However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally. This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case. Bug: skia: Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33 Reviewed-on: https://skia-review.googlesource.com/101560 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Create a Window::Layer interface to reduce sk_app glue codeGravatar Brian Osman2017-12-11
| | | | | | | | | | | | This also makes it possible to manage other parts of viewer, etc (like the stats screen, command set, even samples) as additional layers in the stack. For now, it just removes a lot of boilerplate. Bug: skia: Change-Id: Ic2f80690fc76c683b3736287dc2b738c50d38614 Reviewed-on: https://skia-review.googlesource.com/82688 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove SampleApp and convert HelloWorld to sk_appGravatar Brian Osman2017-11-21
| | | | | | | | | | | | | There is still a large amount of views code that could be trimmed down, but which is used to implement samples (in viewer). Seemed simpler to remove some of this code in pieces. Bug: skia: Change-Id: Ia3415060d03c8de604a154e3dc38379b754daab6 Reviewed-on: https://skia-review.googlesource.com/72801 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Get HelloWorld example running againGravatar Jim Van Verth2017-10-09
| | | | | | | Change-Id: I5956f7c52d265d9f52dd061f1555c54ad092fe76 Reviewed-on: https://skia-review.googlesource.com/57101 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Add Make[backend] calls for creating GrContextsGravatar Greg Daniel2017-07-25
| | | | | | | | | Docs-Preview: https://skia.org/?cl=26369 Bug: skia: Change-Id: I460ee63e466f85b05918479f068a2e5ca2d70550 Reviewed-on: https://skia-review.googlesource.com/26369 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* simplify composing raster surface into windowGravatar Mike Reed2016-09-29
| | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2820 Change-Id: Ifce7bce8b764d2dea02733d823396576a7da609f Reviewed-on: https://skia-review.googlesource.com/2820 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove use of MakeRenderTargetDirect from view systemGravatar robertphillips2016-07-28
| | | | | | | | Here is the CL that sent me down the SkGammaColorFilter path GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2178353005 Review-Url: https://codereview.chromium.org/2178353005
* Lots of progress on switching to SkColorSpace rather than SkColorProfileTypeGravatar brianosman2016-06-16
| | | | | | | | | | Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002 Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170 Review-Url: https://codereview.chromium.org/2069173002
* Revert of Lots of progress switching to SkColorSpace rather than ↵Gravatar brianosman2016-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | SkColorProfileType (patchset #10 id:180001 of https://codereview.chromium.org/2069173002/ ) Reason for revert: Mac crashes in GrUploadPixmapToTexture Original issue's description: > Lots of progress on switching to SkColorSpace rather than SkColorProfileType > > Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld). > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002 > > Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170 TBR=reed@google.com,herb@google.com,msarett@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2072813002
* Lots of progress on switching to SkColorSpace rather than SkColorProfileTypeGravatar brianosman2016-06-16
| | | | | | | | | Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002 Review-Url: https://codereview.chromium.org/2069173002
* Added --deepColor option to SampleApp, triggers creation of a ten-bit/channelGravatar brianosman2016-05-05
| | | | | | | | | | buffer. (Only on Windows at the moment). Uses new effect to do the final gamma adjustment BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1919993002 Review-Url: https://codereview.chromium.org/1919993002
* sRGB support in Ganesh. Several pieces:Gravatar brianosman2016-03-21
| | | | | | | | | | | | | | | | | | | | | | sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows us to disable sRGB -> Linear conversion when reading textures. This gives us an easy way to support "legacy" L32 mode. We disable decoding based on the pixel config of the render target. Textures can override that behavior (specifically for format-conversion draws where we want that behavior). Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA internally, and the external format is BGR order, so TexImage calls will swizzle correctly. This lets us interact with sRGB raster surfaces on BGR platforms. Devices without sRGB support behave like they always have: conversion from color type and profile type ignores sRGB and always returns linear pixel configs. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789663002 Review URL: https://codereview.chromium.org/1789663002
* Revert of sRGB support in Ganesh. Several pieces: (patchset #12 id:220001 of ↵Gravatar brianosman2016-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1789663002/ ) Reason for revert: We're getting sRGB non-8888 configs? Original issue's description: > sRGB support in Ganesh. Several pieces: > > sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows > us to disable sRGB -> Linear conversion when reading textures. This gives > us an easy way to support "legacy" L32 mode. We disable decoding based on > the pixel config of the render target. Textures can override that behavior > (specifically for format-conversion draws where we want that behavior). > > Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA > internally, and the external format is BGR order, so TexImage calls will > swizzle correctly. This lets us interact with sRGB raster surfaces on BGR > platforms. > > Devices without sRGB support behave like they always have: conversion from > color type and profile type ignores sRGB and always returns linear pixel > configs. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789663002 > > Committed: https://skia.googlesource.com/skia/+/9e3f1bf4e5cd8fc59554f986f36d6b034e99f9eb TBR=reed@google.com,bsalomon@google.com,robertphillips@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1814533003
* sRGB support in Ganesh. Several pieces:Gravatar brianosman2016-03-17
| | | | | | | | | | | | | | | | | | | | | | sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows us to disable sRGB -> Linear conversion when reading textures. This gives us an easy way to support "legacy" L32 mode. We disable decoding based on the pixel config of the render target. Textures can override that behavior (specifically for format-conversion draws where we want that behavior). Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA internally, and the external format is BGR order, so TexImage calls will swizzle correctly. This lets us interact with sRGB raster surfaces on BGR platforms. Devices without sRGB support behave like they always have: conversion from color type and profile type ignores sRGB and always returns linear pixel configs. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789663002 Review URL: https://codereview.chromium.org/1789663002
* update callsites for Make image factoriesGravatar reed2016-03-17
| | | | | | | | | | | not forced yet, as we still have the build-guard. waiting on chrome CL BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810813003 TBR= Review URL: https://codereview.chromium.org/1810813003
* detach -> releaseGravatar mtklein2016-03-16
| | | | | | | | | | | | | The C++ standard library uses the name "release" for the operation we call "detach". Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete). This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release". BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002 Review URL: https://codereview.chromium.org/1809733002
* Reland of "Finish conversion to sk_sp<SkShader> (patchset #2 id:20001 of ↵Gravatar reed2016-03-14
| | | | | | | | | | | | | | https://codereview.chromium.org/1803763002/ )" This reverts commit 106e10ddff5d473dc81dd1ce8ade615585ea609b. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1803783002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot TBR= Review URL: https://codereview.chromium.org/1803783002
* Revert of Finish conversion to sk_sp<SkShader> (patchset #2 id:20001 of ↵Gravatar reed2016-03-14
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1803763002/ ) Reason for revert: need to update cmake build example Original issue's description: > Finish conversion to sk_sp<SkShader> > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1803763002 > > TBR= > > Committed: https://skia.googlesource.com/skia/+/15c3a0e55bd9134dace0ace2fffb855a0f09542f TBR= # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1798133003
* Finish conversion to sk_sp<SkShader>Gravatar reed2016-03-14
| | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1803763002 TBR= Review URL: https://codereview.chromium.org/1803763002
* unify peekPixels around pixmap parameterGravatar reed2016-03-09
| | | | | | | | | | requires this chrome CL to land first https://codereview.chromium.org/1775393003/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1784563002 Review URL: https://codereview.chromium.org/1784563002
* There is an unused rowBytes parameter being passed along.Gravatar cblume2016-02-16
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1636873002 Review URL: https://codereview.chromium.org/1636873002
* SampleApp: Remove SkWindow::setColorTypeGravatar kkinnunen2016-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove SkWindow::setColorType, it is used wrong and inconsistently. The color type is actually property of window backbuffer, used when the window is painted with software. This is as opposed to a generic window property that would affect all operation. Similar to MSAA sample count for window GPU backbuffer, the bitmap backbuffer color type should be a parameter of "attach" or "create window" functions, should this property ever be added back. The apps use the call wrong, setting the type as kRGBA_8888 or kBGRRA_8888 without no apparent rationale. These color types are incorrect, as the raster surface can not work with these. Reorganize the SkWindow::resize, since no change in SkWindow backbuffer size does not neccessarily mean that SkView would not need the call. Do not show the sw backbuffer color type in SampleApp title, as it does not really provide any information. On small screens, kBGRA_8888_ColorType fills up the whole title. BUG=skia:4733 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1595503002 Review URL: https://codereview.chromium.org/1595503002
* Move functions from SkGr to SkGrPriv.hGravatar bsalomon2015-10-09
| | | | Review URL: https://codereview.chromium.org/1397123002
* Make SkGraphics::Term a no-op, stop calling it.Gravatar mtklein2015-09-09
| | | | | | | | | | I'd remove it entirely but Android is calling it explicitly. BUG=skia:4259 Committed: https://skia.googlesource.com/skia/+/925979f733fe8e70d84627147dee04d030423349 Review URL: https://codereview.chromium.org/1329853005
* Revert of Make SkGraphics::Term a no-op, stop calling it. (patchset #2 ↵Gravatar mtklein2015-09-09
| | | | | | | | | | | | | | | | | | | | | | | | id:20001 of https://codereview.chromium.org/1329853005/ ) Reason for revert: SK_ATTR_DEPRECATED is meaningful to Android. Don't use it. Original issue's description: > Make SkGraphics::Term a no-op, stop calling it. > > I'd remove it entirely but Android is calling it explicitly. > > BUG=skia:4259 > > Committed: https://skia.googlesource.com/skia/+/925979f733fe8e70d84627147dee04d030423349 TBR=reed@google.com,scroggo@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4259 Review URL: https://codereview.chromium.org/1314483006
* Make SkGraphics::Term a no-op, stop calling it.Gravatar mtklein2015-09-08
| | | | | | | | I'd remove it entirely but Android is calling it explicitly. BUG=skia:4259 Review URL: https://codereview.chromium.org/1329853005
* move HelloWorld to be a peer of SampleAppGravatar caryclark2015-02-02
This is working towards making a simple example part of the buildbot compile step and removing SkExamples from the experimental directory. This works on Mac, Windows, and Linux but isn't complete for Android, ChromeOS and iOS. Review URL: https://codereview.chromium.org/886413004