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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 674543004: OptState owns program descriptor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 79088137caa004519ddcd91d2ad13ad000f5ab40..f7e4a49efa5a2ec48afe292063be9a049fb0226c 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -4,15 +4,15 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
#include "GrGLProgramDesc.h"
+
+#include "GrGLProcessor.h"
#include "GrBackendProcessorFactory.h"
#include "GrProcessor.h"
#include "GrGpuGL.h"
#include "GrOptDrawState.h"
-
#include "SkChecksum.h"
+#include "gl/builders/GrGLFragmentShaderBuilder.h"
/**
* The key for an individual coord transform is made up of a matrix type and a bit that
@@ -179,7 +179,7 @@ bool
GrGLProgramDesc::BuildStagedProcessorKey(const typename ProcessorKeyBuilder::StagedProcessor& stage,
const GrGLCaps& caps,
bool requiresLocalCoordAttrib,
- GrGLProgramDesc* desc,
+ GrProgramDesc* desc,
int* offsetAndSizeIndex) {
GrProcessorKeyBuilder b(&desc->fKey);
uint16_t processorKeySize;
@@ -248,7 +248,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
// --------DO NOT MOVE HEADER ABOVE THIS LINE--------------------------------------------------
// Because header is a pointer into the dynamic array, we can't push any new data into the key
// below here.
- KeyHeader* header = desc->header();
+ GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>();
// make sure any padding in the header is zeroed.
memset(header, 0, kHeaderSize);
@@ -355,9 +355,3 @@ void GrGLProgramDesc::finalize() {
*checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), keyLength);
}
-GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) {
- size_t keyLength = other.keyLength();
- fKey.reset(keyLength);
- memcpy(fKey.begin(), other.fKey.begin(), keyLength);
- return *this;
-}

Powered by Google App Engine
This is Rietveld 408576698