Commit Graph

272 Commits

Author SHA1 Message Date
robertphillips@google.com
5091b7094b Added resource domain to GrTextureDesc
https://codereview.appspot.com/6459062/



git-svn-id: http://skia.googlecode.com/svn/trunk@5028 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-09 10:49:39 +00:00
robertphillips@google.com
1aad28ae16 GrCacheID.h must reside in include\gpu due to inclusion by GrTexture.h
git-svn-id: http://skia.googlecode.com/svn/trunk@5003 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-08 11:07:55 +00:00
robertphillips@google.com
46a8600405 Refactored cacheID in preparation for clip mask caching changes
http://codereview.appspot.com/6458089/



git-svn-id: http://skia.googlecode.com/svn/trunk@5002 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-08 10:42:44 +00:00
reed@google.com
b932407520 add LF at the end, since this is SO important the chrome-mac build failed.
git-svn-id: http://skia.googlecode.com/svn/trunk@4957 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-06 14:37:22 +00:00
bsalomon@google.com
8d3d210e74 Ensure that enums used by GrCustomStage TestCreate functions are declared in SK_ALLOW_GLOBAL_STATIC_INITIALIZERS=0 builds (e.g. android)
git-svn-id: http://skia.googlecode.com/svn/trunk@4953 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-03 18:49:51 +00:00
bsalomon@google.com
2a48c3adb7 Fix includes files missing in release builds from GrCustomStageUnitTest.h.
Also fix SK_SUPPORT_GPU=0 build breaks in gmmain.cpp and GLProgramsTest.cpp




git-svn-id: http://skia.googlecode.com/svn/trunk@4947 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-03 14:54:45 +00:00
bsalomon@google.com
d472620458 Registry-based unit test for custom effects
Review URL: http://codereview.appspot.com/6447085/



git-svn-id: http://skia.googlecode.com/svn/trunk@4946 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-03 14:34:46 +00:00
twiz@google.com
a5e65ec434 Introduction of set of functions to manage generation of texture fetch shader code.
A new set of routines have been added to GrGLShaderBuilder to emit texture fetches, taking into consideration the format of the texture to be accessed, and the channel swizzle.  
Review URL: https://codereview.appspot.com/6446072

git-svn-id: http://skia.googlecode.com/svn/trunk@4919 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-02 15:15:16 +00:00
robertphillips@google.com
a2d71482db Removed GrClip & related classes
http://codereview.appspot.com/6450071/



git-svn-id: http://skia.googlecode.com/svn/trunk@4899 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-01 20:08:47 +00:00
robertphillips@google.com
641f8b19a6 Replace GrClip with SkClipStack
http://codereview.appspot.com/6449070/



git-svn-id: http://skia.googlecode.com/svn/trunk@4865 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-31 19:15:58 +00:00
robertphillips@google.com
7b11289b4e Added dev- & canv- prefixes to Ganesh bounding boxes to indicate coordinate space
http://codereview.appspot.com/6457061/



git-svn-id: http://skia.googlecode.com/svn/trunk@4856 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-31 15:18:21 +00:00
robertphillips@google.com
f8d904a7ee GrClip no longer translates its clips (to better mimic SkClipStack's behavior)
http://codereview.appspot.com/6445052/



git-svn-id: http://skia.googlecode.com/svn/trunk@4848 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-31 12:18:16 +00:00
bsalomon@google.com
cddaf340f1 Remove GrDrawState::setTexture/getTexture
Review URL: http://codereview.appspot.com/6455051/



git-svn-id: http://skia.googlecode.com/svn/trunk@4826 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-30 13:09:05 +00:00
robertphillips@google.com
e4d69c0e46 Added getConservativeBound helper function to GrClipData
http://codereview.appspot.com/6454054/



git-svn-id: http://skia.googlecode.com/svn/trunk@4798 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-26 21:37:40 +00:00
bsalomon@google.com
1c31f63323 Remove texture/mask setters on GrPaint
Review URL: http://codereview.appspot.com/6446052/



git-svn-id: http://skia.googlecode.com/svn/trunk@4790 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-26 19:39:06 +00:00
robertphillips@google.com
beb1af78d0 Altered Ganesh's clip stack plumbing to pass down new GrClipData class
http://codereview.appspot.com/6454047/



git-svn-id: http://skia.googlecode.com/svn/trunk@4788 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-26 18:52:16 +00:00
bsalomon@google.com
b8670998a5 Move filter/wrap out of GrSamplerState into GrTextureParams
Review URL: http://codereview.appspot.com/6440046/




git-svn-id: http://skia.googlecode.com/svn/trunk@4773 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-25 21:27:09 +00:00
tomhudson@google.com
dcba4c2cc3 Use GrMemoryPool to manage GrCustomStage allocations.
Improve memory reclamation of GrMemoryPool for new/delete/new/delete pattern.

http://codereview.appspot.com/6438046/



git-svn-id: http://skia.googlecode.com/svn/trunk@4744 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-24 21:36:16 +00:00
robertphillips@google.com
a6f11c4f71 Gave GrClip an SkClipStack-style iterator
http://codereview.appspot.com/6434046/



git-svn-id: http://skia.googlecode.com/svn/trunk@4723 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-23 17:39:44 +00:00
tomhudson@google.com
1e8f016305 Remove easily-removable uses of setTexture(), instead creating a GrSingleTextureEffect -
where feasible, through convenience function on GrDrawState.

http://codereview.appspot.com/6425055/



git-svn-id: http://skia.googlecode.com/svn/trunk@4694 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-20 16:25:18 +00:00
robertphillips@google.com
80214e26c5 Made clarifying renamings to SkClipStack's iterators (and added to unit test)
http://codereview.appspot.com/6423051/



git-svn-id: http://skia.googlecode.com/svn/trunk@4692 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-20 15:33:18 +00:00
bsalomon@google.com
e3d3216fe1 Remove stage masks
Review URL: http://codereview.appspot.com/6422047/



git-svn-id: http://skia.googlecode.com/svn/trunk@4688 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-20 13:37:06 +00:00
rileya@google.com
24f3ad1bbb Move texture lock/unlock functions from SkGpuDevice into SkGr as global functions, also removed inconsistent "SkGr" class.
Review URL: https://codereview.appspot.com/6420048

git-svn-id: http://skia.googlecode.com/svn/trunk@4664 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-18 21:47:40 +00:00
twiz@google.com
5807116946 This CL implements the Ganesh path for the SkTable_ColorFilter color transformation.
A new texture stage dedicated to color transforms has been added, along with the new custom stage implementing the LUT.
Review URL: https://codereview.appspot.com/6351081

git-svn-id: http://skia.googlecode.com/svn/trunk@4663 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-18 21:41:50 +00:00
senorblanco@chromium.org
1e95d715d0 Clean up the use of AutoScratchTexture in the gaussian blur and morphology
filters.  Instead of passing in AutoScratchTextures for temporaries, we allocate
them inside the function and detach() after rendering.  Since the functions now
return a ref()'ed texture, we no longer ref() the result in filter_texture().

Also, the imageblur gm was passing a paint with an image filter both to
saveLayer()/restore(), and to every text draw call.  Back when only restore()
was applying filters, this was fine, but since we're now applying filters on all
draw calls, this means we're double-blurring in this GM.

I've reverted the Mac baselines for the imageblur GM to their previous versions;
hopefully this will be correct.



git-svn-id: http://skia.googlecode.com/svn/trunk@4659 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-18 19:52:53 +00:00
tomhudson@google.com
2f68e7684b Move texture domains onto a GrCustomStage, off of GrSamplerState.
This will require gyp changes to roll into Chrome.

http://codereview.appspot.com/6405050/



git-svn-id: http://skia.googlecode.com/svn/trunk@4641 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-17 18:43:21 +00:00
tomhudson@google.com
e742bf0ab1 Start removing calls to GrDrawState::setTexture() (and GrPaint::setTexture()?) when there's
a GrSingleTextureEffect involved holding the texture.

http://codereview.appspot.com/6353094/



git-svn-id: http://skia.googlecode.com/svn/trunk@4608 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-13 19:54:19 +00:00
robertphillips@google.com
40a1ae4df2 Added SkDevice onAttachToCanvas & onDetachFromCanvas methods
http://codereview.appspot.com/6348100/



git-svn-id: http://skia.googlecode.com/svn/trunk@4598 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-13 15:36:15 +00:00
tomhudson@google.com
d0c1a06cb9 Introduces new SingleTextureEffect base class for GrCustomStage objects.
This class tracks the texture that the object uses. A future commit will get rid of the
GrTexture pointer currenty stored in the GrDrawState, allowing us to have CustomStages
*without* textures.

Requires gyp change on next roll.

http://codereview.appspot.com/6306097/



git-svn-id: http://skia.googlecode.com/svn/trunk@4576 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-12 17:23:52 +00:00
robertphillips@google.com
56c79b1037 Added GrContext::AutoClipStack to encapsulate setting\resetting of clip stack
http://codereview.appspot.com/6343097/



git-svn-id: http://skia.googlecode.com/svn/trunk@4558 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-11 20:57:46 +00:00
robertphillips@google.com
fea85ac3e3 Minor refactoring to make GrAutoMatrix a nested sub-class of GrContext
http://codereview.appspot.com/6356092/



git-svn-id: http://skia.googlecode.com/svn/trunk@4549 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-11 18:53:23 +00:00
robertphillips@google.com
3e11c0bd92 Forced GrClip to always have conservative bounds
http://codereview.appspot.com/6353089/



git-svn-id: http://skia.googlecode.com/svn/trunk@4545 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-11 18:20:35 +00:00
senorblanco@chromium.org
894790d77c This patch implements the diffuse and specular lighting filters in Ganesh.
There are three light types for each:  distant, point and spot, whose code
generation lives in a GrGLLight class hierarchy.  This similar to the CPU
implementation, where each light type provides a function to compute the vector
from the surface plane to the light (surfaceToLight) and to compute the light
colour (emitLightColour).  Instead of templated member functions, as in the CPU
implementation, these are virtual functions to emit the light-specific GLSL
code.

All of the code for the GPU path lives in the same file as that for the CPU
path, SkLightingImageFilter.cpp.  In order to provide Ganesh a hook to access
it, SkImageFilter now has a asNewCustomStage() virtual, which allows an image
filter to return a GrCustomStage representing that filter.

Note that this patch does not handle the border conditions correctly (the
[top|bottom][Left|Right]Normal() functions in the CPU implementation).  That
will come in a future patch.

Review URL: http://codereview.appspot.com/6345081/



git-svn-id: http://skia.googlecode.com/svn/trunk@4535 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-11 16:01:22 +00:00
robertphillips@google.com
59f46b81f8 Fixed Windows compiler complaints
http://codereview.appspot.com/6392044



git-svn-id: http://skia.googlecode.com/svn/trunk@4511 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-10 17:30:58 +00:00
tomhudson@google.com
c377baf406 Add placement new macros to SkPostConfig, call SkNEW* from Ganesh.
TODO: unify with the placement new implementation in SkTemplatesPriv.h,
once various issues there are overcome. reed@ should be taking the lead
there.

http://codereview.appspot.com/6384043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4492 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-09 20:17:56 +00:00
tomhudson@google.com
2c026196e7 Fix misnamed function in explanatory comment.
http://codereview.appspot.com/6387043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4489 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-09 19:07:41 +00:00
tomhudson@google.com
1dcfa1fcbd Fix definition of isEqual() for two gradient effect custom stages.
Expand comments defining isEqual() to better distinguish equality from
equivalence, which is more significant in Ganesh shader cache management.

http://codereview.appspot.com/6379043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4484 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-09 18:21:28 +00:00
robertphillips@google.com
54823c227d Rolling back r4034 (Proposed plumbing to propagate save & restore)
http://codereview.appspot.com/6346066/



git-svn-id: http://skia.googlecode.com/svn/trunk@4456 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-07-03 19:12:29 +00:00
robertphillips@google.com
41efe04af9 Partially rolled forward the SkGrPixelRef changes
http://codereview.appspot.com/6354060/



git-svn-id: http://skia.googlecode.com/svn/trunk@4415 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-29 20:55:14 +00:00
tomhudson@google.com
375ff85e96 Un-trifurcate GrTextContext: get rid of Default and Batched subclasses,
folding their functionality back into the base class.

Requires gyp changes.

http://codereview.appspot.com/6357048/



git-svn-id: http://skia.googlecode.com/svn/trunk@4411 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-29 18:37:57 +00:00
robertphillips@google.com
ecf1f3299a Temporarily readding SkGrTexturePixelRef.h/.cpp until WebKit is transitioned to SkGrPixelRef
git-svn-id: http://skia.googlecode.com/svn/trunk@4401 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-28 21:59:38 +00:00
robertphillips@google.com
5088eb49fe Moved SkGrTexturePixelRef to SkGrPixelRef
http://codereview.appspot.com/6344054/



git-svn-id: http://skia.googlecode.com/svn/trunk@4397 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-28 20:59:13 +00:00
robertphillips@google.com
d881bc194d Collapsed SkGrTexturePixelRef and SkGrRenderTargetPixelRef into SkGrPixelRef using new GrSurface class
http://codereview.appspot.com/6359045/



git-svn-id: http://skia.googlecode.com/svn/trunk@4396 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-28 20:02:39 +00:00
bsalomon@google.com
ded4f4b163 Initial support for GL_NV_path_renering. Experimental, there are still some issues to resolve, set gyp variable skia_nv_path_rendering=1 or build flag GR_GL_USE_NV_PATH_RENDERING to enable.
http://codereview.appspot.com/6349049/



git-svn-id: http://skia.googlecode.com/svn/trunk@4390 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-28 18:48:06 +00:00
reed@google.com
fa35e3ddcc plumb SkInstCnt to all subclasses of GrRefCnt
git-svn-id: http://skia.googlecode.com/svn/trunk@4353 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-26 20:16:17 +00:00
tomhudson@google.com
f13f588046 Add GrPaint::*StageEnabled() and GrDrawState::stageEnabled() functions.
These wrap the question of "is this stage of the shader enabled?" so that
we can change the semantics - previously iff there was a texture, now
if there is a texture OR a GrCustomStage, soon (post-cl 6306097) iff there
is a GrCustomStage, which at that point will hold whatever texture is
necessary.

http://codereview.appspot.com/6306104/



git-svn-id: http://skia.googlecode.com/svn/trunk@4325 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-25 17:27:28 +00:00
bsalomon@google.com
07fc0d178e Revert r4287. Large numbers of textures created by random gradients can cause poor driver performance (at least on Mac)
BUG=670



git-svn-id: http://skia.googlecode.com/svn/trunk@4306 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-22 15:15:59 +00:00
robertphillips@google.com
15c0fea699 AutoScratchTexture can now release its texture and it will return to the texture cache when freed
http://codereview.appspot.com/6262043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4301 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-22 12:41:43 +00:00
bsalomon@google.com
5e24129831 Move GrTemplates.h to src
Review URL: http://codereview.appspot.com/6333053/


git-svn-id: http://skia.googlecode.com/svn/trunk@4300 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-22 12:34:22 +00:00
robertphillips@google.com
9ec075366e Altered GrDrawState to always ref texture and render target
http://codereview.appspot.com/6251049/



git-svn-id: http://skia.googlecode.com/svn/trunk@4298 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-22 12:01:30 +00:00