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

Side by Side Diff: cc/output/gl_renderer.cc

Issue 1653983002: cc: Avoid extra flush calls to Skia GrContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/raster/gpu_rasterizer.cc » ('j') | cc/raster/gpu_rasterizer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 SkMatrix local_matrix; 648 SkMatrix local_matrix;
649 local_matrix.setScale(scale.x(), scale.y()); 649 local_matrix.setScale(scale.x(), scale.y());
650 skia::RefPtr<SkImageFilter> filter_with_local_scale = 650 skia::RefPtr<SkImageFilter> filter_with_local_scale =
651 skia::AdoptRef(filter->newWithLocalMatrix(local_matrix)); 651 skia::AdoptRef(filter->newWithLocalMatrix(local_matrix));
652 652
653 SkPaint paint; 653 SkPaint paint;
654 paint.setImageFilter(filter_with_local_scale.get()); 654 paint.setImageFilter(filter_with_local_scale.get());
655 surface->getCanvas()->translate(-dst_rect.x(), -dst_rect.y()); 655 surface->getCanvas()->translate(-dst_rect.x(), -dst_rect.y());
656 surface->getCanvas()->drawImage(srcImage.get(), src_rect.x(), src_rect.y(), 656 surface->getCanvas()->drawImage(srcImage.get(), src_rect.x(), src_rect.y(),
657 &paint); 657 &paint);
658 658 surface->getCanvas()->flush();
659 skia::RefPtr<SkImage> image = skia::AdoptRef(surface->newImageSnapshot()); 659 skia::RefPtr<SkImage> image = skia::AdoptRef(surface->newImageSnapshot());
660 if (!image || !image->isTextureBacked()) { 660 if (!image || !image->isTextureBacked()) {
661 return skia::RefPtr<SkImage>(); 661 return skia::RefPtr<SkImage>();
662 } 662 }
663 663
664 CHECK(image->isTextureBacked()); 664 CHECK(image->isTextureBacked());
665 return image; 665 return image;
666 } 666 }
667 667
668 bool GLRenderer::CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode) { 668 bool GLRenderer::CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode) {
(...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after
3597 texture_id = pending_overlay_resources_.back()->texture_id(); 3597 texture_id = pending_overlay_resources_.back()->texture_id();
3598 } 3598 }
3599 3599
3600 context_support_->ScheduleOverlayPlane( 3600 context_support_->ScheduleOverlayPlane(
3601 overlay.plane_z_order, overlay.transform, texture_id, 3601 overlay.plane_z_order, overlay.transform, texture_id,
3602 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3602 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3603 } 3603 }
3604 } 3604 }
3605 3605
3606 } // namespace cc 3606 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/raster/gpu_rasterizer.cc » ('j') | cc/raster/gpu_rasterizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698