diff options
author | vmpstr <vmpstr@chromium.org> | 2015-06-02 15:14:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-02 22:15:17 +0000 |
commit | 0eca2e87110112c678c5f4c89b7f99e2de6026bb (patch) | |
tree | 6a3e39b085e5d8851c42ccf0b8a0f3e0a92775f6 /cc/output/software_renderer.cc | |
parent | 6c8207fe7d79a2150ce7c4007678d10c23475630 (diff) | |
download | chromium_src-0eca2e87110112c678c5f4c89b7f99e2de6026bb.zip chromium_src-0eca2e87110112c678c5f4c89b7f99e2de6026bb.tar.gz chromium_src-0eca2e87110112c678c5f4c89b7f99e2de6026bb.tar.bz2 |
cc: Remove DrawQuad::IterateResoruces
This patch removes IterateResources function in favor of
iterating resources directly on the quad. In order to
accomplish this, each derived quad uses new resources
object on the base class to store all of the resources
it needs. This allows the calling code that used to call
IterateResources with a callback to instead directly
iterate all of the ids and manipulate them in any way
that is required.
This improves the performance of the IterateResources
test by ~30%.
BUG=492765
R=danakj, piman@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1152473006
Cr-Commit-Position: refs/heads/master@{#332476}
Diffstat (limited to 'cc/output/software_renderer.cc')
-rw-r--r-- | cc/output/software_renderer.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc index 3381ab1..992dbc9 100644 --- a/cc/output/software_renderer.cc +++ b/cc/output/software_renderer.cc @@ -415,14 +415,14 @@ void SoftwareRenderer::DrawSolidColorQuad(const DrawingFrame* frame, void SoftwareRenderer::DrawTextureQuad(const DrawingFrame* frame, const TextureDrawQuad* quad) { - if (!IsSoftwareResource(quad->resource_id)) { + if (!IsSoftwareResource(quad->resource_id())) { DrawUnsupportedQuad(frame, quad); return; } // TODO(skaslev): Add support for non-premultiplied alpha. ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, - quad->resource_id); + quad->resource_id()); if (!lock.valid()) return; const SkBitmap* bitmap = lock.sk_bitmap(); @@ -480,10 +480,10 @@ void SoftwareRenderer::DrawTileQuad(const DrawingFrame* frame, // |resource_provider_| can be NULL in resourceless software draws, which // should never produce tile quads in the first place. DCHECK(resource_provider_); - DCHECK(IsSoftwareResource(quad->resource_id)); + DCHECK(IsSoftwareResource(quad->resource_id())); ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, - quad->resource_id); + quad->resource_id()); if (!lock.valid()) return; DCHECK_EQ(GL_CLAMP_TO_EDGE, lock.wrap_mode()); @@ -560,9 +560,9 @@ void SoftwareRenderer::DrawRenderPassQuad(const DrawingFrame* frame, } current_paint_.setShader(shader.get()); - if (quad->mask_resource_id) { - ResourceProvider::ScopedReadLockSoftware mask_lock(resource_provider_, - quad->mask_resource_id); + if (quad->mask_resource_id()) { + ResourceProvider::ScopedReadLockSoftware mask_lock( + resource_provider_, quad->mask_resource_id()); if (!lock.valid()) return; SkShader::TileMode mask_tile_mode = WrapModeToTileMode( |