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

Side by Side Diff: cc/resources/resource_provider.cc

Issue 1684193004: cc: Avoid extra flush calls to Skia GrContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-avoid-extra-flushes
Patch Set: deps 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 | « cc/raster/scoped_gpu_raster.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 if (can_use_lcd_text) { 995 if (can_use_lcd_text) {
996 // LegacyFontHost will get LCD text and skia figures out what type to use. 996 // LegacyFontHost will get LCD text and skia figures out what type to use.
997 surface_props = 997 surface_props =
998 SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType); 998 SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType);
999 } 999 }
1000 sk_surface_ = skia::AdoptRef( 1000 sk_surface_ = skia::AdoptRef(
1001 SkSurface::NewWrappedRenderTarget(gr_context, desc, &surface_props)); 1001 SkSurface::NewWrappedRenderTarget(gr_context, desc, &surface_props));
1002 } 1002 }
1003 1003
1004 void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() { 1004 void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() {
1005 sk_surface_->getCanvas()->flush();
1005 sk_surface_.clear(); 1006 sk_surface_.clear();
1006 } 1007 }
1007 1008
1008 ResourceProvider::SynchronousFence::SynchronousFence( 1009 ResourceProvider::SynchronousFence::SynchronousFence(
1009 gpu::gles2::GLES2Interface* gl) 1010 gpu::gles2::GLES2Interface* gl)
1010 : gl_(gl), has_synchronized_(true) { 1011 : gl_(gl), has_synchronized_(true) {
1011 } 1012 }
1012 1013
1013 ResourceProvider::SynchronousFence::~SynchronousFence() { 1014 ResourceProvider::SynchronousFence::~SynchronousFence() {
1014 } 1015 }
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 1789
1789 const int kImportance = 2; 1790 const int kImportance = 2;
1790 pmd->CreateSharedGlobalAllocatorDump(guid); 1791 pmd->CreateSharedGlobalAllocatorDump(guid);
1791 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); 1792 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
1792 } 1793 }
1793 1794
1794 return true; 1795 return true;
1795 } 1796 }
1796 1797
1797 } // namespace cc 1798 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/scoped_gpu_raster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698